Vuo  2.4.0
VuoGlPool.h
Go to the documentation of this file.
1
10#pragma once
11
12#ifdef __cplusplus
13extern "C"
14{
15#endif
16
17#include "VuoGlContext.h"
18#include "VuoImage.h"
19#include "VuoMesh.h"
20
21#include <stdint.h>
22
26typedef enum
27{
28 VuoGlPool_ArrayBuffer,
29 VuoGlPool_ElementArrayBuffer
30// VuoGlPool_Texture ///< @see VuoGlTexturePool_use
31// VuoGlPool_Framebuffer ///< Cannot be shared between contexts
32// VuoGlPool_VertexArray ///< Cannot be shared between contexts
34
35GLuint VuoGlPool_use(VuoGlContext glContext, VuoGlPoolType type, unsigned long size);
36
42#define VuoGlPool_retain(glBufferName) VuoGlPool_retainF(glBufferName, __FILE__, __LINE__, __func__);
43void VuoGlPool_retainF(GLuint glBufferName, const char *file, unsigned int linenumber, const char *func);
44
51#define VuoGlPool_release(type, size, glBufferName) VuoGlPool_releaseF(type, size, glBufferName, __FILE__, __LINE__, __func__);
52void VuoGlPool_releaseF(VuoGlPoolType type, unsigned long size, GLuint glBufferName, const char *file, unsigned int linenumber, const char *func);
53
57typedef enum
58{
59 VuoGlTexturePool_NoAllocation,
60 VuoGlTexturePool_Allocate,
61 VuoGlTexturePool_AllocateIOSurface,
63
64GLuint VuoGlTexturePool_use(VuoGlContext glContext, VuoGlTexturePoolAllocation allocation, GLenum target, GLenum internalformat, unsigned short width, unsigned short height, GLenum format, void *ioSurfaceRef);
65void VuoGlTexturePool_disuse(VuoGlTexturePoolAllocation allocation, GLenum target, GLenum internalformat, unsigned short width, unsigned short height, GLuint name);
66
67GLuint VuoGlTexture_getType(GLuint format);
68unsigned char VuoGlTexture_getChannelCount(GLuint format);
69unsigned char VuoGlTexture_getBytesPerPixel(GLuint internalformat, GLuint format);
70unsigned char VuoGlTexture_getBytesPerPixelForInternalFormat(GLuint internalformat);
71bool VuoGlTexture_formatHasAlphaChannel(GLuint format);
72
74
75void VuoGlTexture_retain(GLuint glTextureName, VuoImage_freeCallback freeCallback, void *freeCallbackContext);
76void VuoGlTexture_release(VuoGlTexturePoolAllocation allocation, GLuint glTextureTarget, GLenum internalformat, unsigned short width, unsigned short height, GLuint glTextureName);
77void VuoGlTexture_disown(GLuint glTextureName);
78
79typedef void * VuoIoSurface;
80VuoIoSurface VuoIoSurfacePool_use(VuoGlContext glContext, unsigned short pixelsWide, unsigned short pixelsHigh, GLuint *outputTexture);
83unsigned short VuoIoSurfacePool_getWidth(VuoIoSurface vis);
86void VuoIoSurfacePool_disuse(VuoIoSurface vis, bool quarantine);
87
88void VuoIoSurfacePool_signal(void *ioSurface);
89
90GLuint VuoGlShader_use(VuoGlContext glContext, GLenum type, const char *source, void *outIssues);
91
95typedef struct
96{
97 GLuint programName;
98
99 void *uniforms;
101
102VuoGlProgram VuoGlProgram_use(VuoGlContext glContext, const char *description, GLuint vertexShaderName, GLuint geometryShaderName, GLuint fragmentShaderName, VuoMesh_ElementAssemblyMethod assemblyMethod, unsigned int expectedOutputPrimitiveCount, void *outIssues);
103int VuoGlProgram_getUniformLocation(VuoGlProgram program, const char *uniformIdentifier);
104
105char *VuoGl_stringForConstant(GLenum constant);
106
107void VuoGlPool_logVRAMAllocated(unsigned long bytesAllocated);
108void VuoGlPool_logVRAMFreed(unsigned long bytesFreed);
109
110#ifdef __cplusplus
111}
112#endif