MeVisLab Toolbox Reference
GLContextStack Class Reference

Manages a stack of GL contexts and their correct activation (NOTE: This is only accessible in the GUI main thread!) 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 platform specific state) to the stack More...
 
static void popCurrentContext ()
 pops the previously pushed context and activates it More...
 
static void createTemporaryContextAndActivate ()
 Pushes the current context and creates and activates a new temporary OpenGL context which may be used to query GL capabilities. More...
 
static void destroyTemporaryContextAndActivatePreviousContext ()
 Destroys the temporary context created via createTemporaryContextAndActivate() and pops/activates the previous context. More...
 

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 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.

Referenced by GLContextStack::TemporaryGLContextScope::TemporaryGLContextScope().

◆ destroyTemporaryContextAndActivatePreviousContext()

static void GLContextStack::destroyTemporaryContextAndActivatePreviousContext ( )
static

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

Referenced by GLContextStack::TemporaryGLContextScope::~TemporaryGLContextScope().

◆ popCurrentContext()

static void GLContextStack::popCurrentContext ( )
static

pops the previously pushed context and activates it

Referenced by GLContextStack::StoreCurrentGLContextScope::~StoreCurrentGLContextScope().

◆ pushCurrentContext()

static void GLContextStack::pushCurrentContext ( )
static

pushes the current OpenGL context (detected via platform specific state) to the stack

Referenced by GLContextStack::StoreCurrentGLContextScope::StoreCurrentGLContextScope().


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