Image Component Library (ICL)
|
Shallow Wrapper class around GLX and QGLContext instances. More...
#include <GLContext.h>
Public Types | |
typedef void * | Handle |
internal handle type | |
Public Member Functions | |
GLContext () | |
creates a null context | |
GLContext (Handle handle, bool isGLX, long unsigned int pbuffer=0, Handle display=0) | |
create a new context either of type GLXContext or of type QGLContext* | |
void | makeCurrent () const |
selects the given context (makes it 'current') | |
bool | isNull () const |
returns whether a context is null | |
operator bool () const | |
returns whether a contest is no null | |
bool | operator< (const GLContext &other) const |
bool | operator== (const GLContext &other) const |
comparison operator | |
Static Public Member Functions | |
static GLContext | currentContext () |
returns the current context | |
static void | set_current_glx_context (Handle handle, long unsigned int pbuffer, Handle display) |
sets ths curretn GLXContext | |
static void | unset_current_glx_context () |
Protected Attributes | |
Handle | handle |
context handle (either of type QGLContext* or GLXContext) | |
bool | isGLX |
defines how to interpret handle | |
long unsigned int | pbuffer |
for GLXContexts only: corresponding pbuffer ID | |
Handle | display |
for GLXContexts only: current X-Display | |
Static Protected Attributes | |
static GLContext | current_glx_context |
static instance (only necessary for GLXContexts) |
Shallow Wrapper class around GLX and QGLContext instances.
The GLContext class can be used to query the current GLContext activated. Right now, ICL knows two different kinds of GLContexts:
The GLContex class provides a generic access to both types of contexts.
Please note that the GLContext class does right now only work in ICL. It is used in the GLFragmentShader class to determine wheter a given shader has already been compiled and set up for the current active GLContext.
typedef void* icl::qt::GLContext::Handle |
internal handle type
icl::qt::GLContext::GLContext | ( | ) | [inline] |
creates a null context
icl::qt::GLContext::GLContext | ( | Handle | handle, |
bool | isGLX, | ||
long unsigned int | pbuffer = 0 , |
||
Handle | display = 0 |
||
) | [inline] |
create a new context either of type GLXContext or of type QGLContext*
Actually, this constructor should not be called manually
static GLContext icl::qt::GLContext::currentContext | ( | ) | [static] |
returns the current context
bool icl::qt::GLContext::isNull | ( | ) | const [inline] |
returns whether a context is null
void icl::qt::GLContext::makeCurrent | ( | ) | const |
selects the given context (makes it 'current')
icl::qt::GLContext::operator bool | ( | ) | const [inline] |
returns whether a contest is no null
bool icl::qt::GLContext::operator< | ( | const GLContext & | other | ) | const [inline] |
bool icl::qt::GLContext::operator== | ( | const GLContext & | other | ) | const [inline] |
comparison operator
static void icl::qt::GLContext::set_current_glx_context | ( | Handle | handle, |
long unsigned int | pbuffer, | ||
Handle | display | ||
) | [static] |
sets ths curretn GLXContext
This is automatically done as long as the scene class instances is rendered into an offscreen rendering context
static void icl::qt::GLContext::unset_current_glx_context | ( | ) | [static] |
This is automatically called when Scene::render is finished and not offscreen rendering contexts are active any more.
GLContext icl::qt::GLContext::current_glx_context [static, protected] |
static instance (only necessary for GLXContexts)
Handle icl::qt::GLContext::display [protected] |
for GLXContexts only: current X-Display
Handle icl::qt::GLContext::handle [protected] |
context handle (either of type QGLContext* or GLXContext)
bool icl::qt::GLContext::isGLX [protected] |
defines how to interpret handle
long unsigned int icl::qt::GLContext::pbuffer [protected] |
for GLXContexts only: corresponding pbuffer ID