MeVisLab Resolution Independence API
ml::GLContextStack Class Reference

Manages a stack of GL contexts and their correct activation. More...

#include <mlGLContext.h>

Classes

class  StoreCurrentGLContextScope
 Stores the current GL context and re-activates it when the scope object is deleted. More...
 
class  TemporaryGLContextScope
 Creates a temporary OpenGL context and destroys it when the object goes out of scope. More...
 

Static Public Member Functions

static void pushCurrentContext ()
 Pushes the current OpenGL context (detected via a platform-specific state) to the stack.
 
static void popCurrentContext ()
 Pops the previously pushed context and activates it.
 
static void createTemporaryContextAndActivate ()
 Pushes the current context and creates and activates a new temporary OpenGL context, which may be used to query GL capabilities.
 
static void destroyTemporaryContextAndActivatePreviousContext ()
 Destroys the temporary context created via createTemporaryContextAndActivate() and pops/activates the previous context.
 

Detailed Description

Manages a stack of GL contexts and their correct activation.

Note: This is only accessible in the GUI main thread!

Definition at line 27 of file mlGLContext.h.

Member Function Documentation

◆ createTemporaryContextAndActivate()

static void ml::GLContextStack::createTemporaryContextAndActivate ( )
static

Pushes the current context and creates and activates a new temporary OpenGL context, which may be used to query GL capabilities.

Note: This call needs to be paired with a call to destroyTemporaryContextAndActivatePreviousContext() to cleanup the allocated context.

◆ destroyTemporaryContextAndActivatePreviousContext()

static void ml::GLContextStack::destroyTemporaryContextAndActivatePreviousContext ( )
static

Destroys the temporary context created via createTemporaryContextAndActivate() and pops/activates the previous context.

◆ popCurrentContext()

static void ml::GLContextStack::popCurrentContext ( )
static

Pops the previously pushed context and activates it.

◆ pushCurrentContext()

static void ml::GLContextStack::pushCurrentContext ( )
static

Pushes the current OpenGL context (detected via a platform-specific state) to the stack.


The documentation for this class was generated from the following file: