Vuo  1.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Typedefs | Functions
VuoGlContext.h File Reference

Description

VuoGlContext interface.

Macros

#define VuoGlContext_disuse(glContext)   VuoGlContext_disuseF(glContext, __FILE__, __LINE__, __func__)
 Throws the specified VuoGlContext back in the pool.
 
#define VGL()   _VGL(cgl_ctx, __FILE__, __LINE__, __func__);
 If there's an OpenGL error, prints info about it.
 

Typedefs

typedef void * VuoGlContext
 A framebuffer and state for GL rendering.
 

Functions

bool VuoGlContext_isMultisamplingFunctional (VuoGlContext context)
 Returns true if Vuo should possibly use multisampling for the specified context's GPU.
 
void VuoGlContext_setGlobalRootContext (void *rootContext)
 Specifies a platform-specific context to be used as the base for all of Vuo's shared GL contexts.
 
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.
 
void VuoGlContext_disuseF (VuoGlContext glContext, const char *file, const unsigned int line, const char *func)
 Helper for VuoGlContext_disuse.
 
void * VuoGlContext_makePlatformPixelFormat (bool hasDepthBuffer)
 Returns a platform-specific OpenGL pixelformat description.
 
void _VGL (CGLContextObj cgl_ctx, const char *file, const unsigned int line, const char *func)
 Helper for VGL().
 

Macro Definition Documentation

#define VGL ( )    _VGL(cgl_ctx, __FILE__, __LINE__, __func__);

If there's an OpenGL error, prints info about it.

Useful for debugging.

Example:
void nodeEvent()
{
CGLContextObj cgl_ctx = (CGLContextObj)VuoGlContext_use();
glEnable(GL_ALPHA);
VGL();
}
#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.

Typedef Documentation

typedef void* VuoGlContext

A framebuffer and state for GL rendering.

Function Documentation

void _VGL ( CGLContextObj  cgl_ctx,
const char *  file,
const unsigned int  line,
const char *  func 
)

Helper for VGL().

void VuoGlContext_disuseF ( VuoGlContext  glContext,
const char *  file,
const unsigned int  line,
const char *  func 
)

Helper for VuoGlContext_disuse.

bool VuoGlContext_isMultisamplingFunctional ( VuoGlContext  context)

Returns true if Vuo should possibly use multisampling for the specified context's GPU.

Multisampling is known to break point rendering on some GPUs, so we intentionally disable it on those.

void* VuoGlContext_makePlatformPixelFormat ( bool  hasDepthBuffer)

Returns a platform-specific OpenGL pixelformat description.

On Mac OS X, this is a CGLPixelFormatObj.

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.

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.