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

Description

VuoGlContext interface.

Macros

#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

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_disuse (VuoGlContext glContext)
 Throws the specified VuoGlContext back in the pool.
 
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();
}

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_disuse ( VuoGlContext  glContext)

Throws the specified VuoGlContext back in the pool.

This function may be called from any thread.

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.

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.