VuoGlContext interface.
Definition in file VuoGlContext.h.
Go to the source code of this file.
Macros | |
#define | VuoGlContext_disuse(glContext) VuoGlContext_disuseF(glContext, __FILE__, __LINE__, __func__) |
Throws the specified VuoGlContext back in the pool. More... | |
#define | VGL() _VGL(cgl_ctx, __FILE__, __LINE__, __func__); |
If there's an OpenGL error, prints info about it. More... | |
Typedefs | |
typedef void * | VuoGlContext |
A framebuffer and state for GL rendering. More... | |
Functions | |
int | VuoGlContext_getMaximumSupportedMultisampling (VuoGlContext context) |
Returns the maximum supported multisampling level for this GPU. More... | |
void | VuoGlContext_setGlobalRootContext (void *rootContext) |
Specifies a platform-specific context to be used as the base for all of Vuo's shared GL contexts. More... | |
VuoGlContext | VuoGlContext_use (void) |
Finds an unused GL context in the process-wide shared context pool (or creates one if none is available), marks it used, and returns it. More... | |
void | VuoGlContext_perform (void(^function)(CGLContextObj cgl_ctx)) |
Executes code using the global OpenGL context. More... | |
void | VuoGlContext_disuseF (VuoGlContext glContext, const char *file, const unsigned int linenumber, const char *func) |
Throws the specified context back in the pool. More... | |
void * | VuoGlContext_makePlatformPixelFormat (bool hasDepthBuffer, bool openGL32Core, GLint displayMask) |
Returns a platform-specific OpenGL pixelformat description. More... | |
bool | VuoGlContext_isOpenGL32Core (VuoGlContext context) |
Returns true if the specified context is OpenGL 3.2+ Core Profile. More... | |
void | _VGL (CGLContextObj cgl_ctx, const char *file, const unsigned int linenumber, const char *func) |
Helper for VGL() . More... | |
#define VGL | ( | ) | _VGL(cgl_ctx, __FILE__, __LINE__, __func__); |
If there's an OpenGL error, prints info about it.
Useful for debugging.
Definition at line 61 of file VuoGlContext.h.
#define VuoGlContext_disuse | ( | glContext | ) | VuoGlContext_disuseF(glContext, __FILE__, __LINE__, __func__) |
Throws the specified VuoGlContext
back in the pool.
This function may be called from any thread.
Definition at line 38 of file VuoGlContext.h.
typedef void* VuoGlContext |
A framebuffer and state for GL rendering.
Definition at line 22 of file VuoGlContext.h.
void _VGL | ( | CGLContextObj | cgl_ctx, |
const char * | file, | ||
const unsigned int | linenumber, | ||
const char * | func | ||
) |
Helper for VGL()
.
Definition at line 768 of file VuoGlContext.cc.
void VuoGlContext_disuseF | ( | VuoGlContext | glContext, |
const char * | file, | ||
const unsigned int | linenumber, | ||
const char * | func | ||
) |
Throws the specified context back in the pool.
This function may be called from any thread.
Definition at line 293 of file VuoGlContext.cc.
int VuoGlContext_getMaximumSupportedMultisampling | ( | VuoGlContext | context | ) |
Returns the maximum supported multisampling level for this GPU.
Multisampling is known to break point rendering on some GPUs, so we intentionally disable it on those.
Definition at line 592 of file VuoGlContext.cc.
bool VuoGlContext_isOpenGL32Core | ( | VuoGlContext | context | ) |
Returns true if the specified context
is OpenGL 3.2+ Core Profile.
Definition at line 748 of file VuoGlContext.cc.
void* VuoGlContext_makePlatformPixelFormat | ( | bool | hasDepthBuffer, |
bool | openGL32Core, | ||
GLint | displayMask | ||
) |
Returns a platform-specific OpenGL pixelformat description.
On Mac OS X, this is a CGLPixelFormatObj
.
hasDepthBuffer | If true, the returned context will have a depth buffer. |
openGL32Core | If true, the returned context will be OpenGL 3.2 Core Profile. If false, OpenGL 2.1. |
displayMask | If -1, the context will not be restricted by display. If nonzero, the context will be restricted to the specified displays (CGDisplayIDToOpenGLDisplayMask() ). If the low byte is 0xff, the context will use the Apple Software Renderer. |
Definition at line 631 of file VuoGlContext.cc.
void VuoGlContext_perform | ( | void(^)(CGLContextObj cgl_ctx) | function | ) |
Executes code using the global OpenGL context.
This function may be called from any thread.
Definition at line 392 of file VuoGlContext.cc.
void VuoGlContext_setGlobalRootContext | ( | void * | rootContext | ) |
Specifies a platform-specific context to be used as the base for all of Vuo's shared GL contexts.
On Mac, this should be a CGLContext
. The CGLContext
must be unlocked when calling this function, but after that you may lock it at any time (Vuo doesn't require it to be locked or unlocked).
Must be called before any Vuo composition is loaded, and before any other VuoGlContext_*
methods.
This function may be called from any thread.
Definition at line 545 of file VuoGlContext.cc.
VuoGlContext VuoGlContext_use | ( | void | ) |
Finds an unused GL context in the process-wide shared context pool (or creates one if none is available), marks it used, and returns it.
This function may be called from any thread.
Definition at line 254 of file VuoGlContext.cc.