ROOT logo
ROOT » GRAF3D » GL » TGLContext

class TGLContext


 This class encapsulates window-system specific information about a
 GL-context and alows their proper management in ROOT.

Function Members (Methods)

public:
TGLContext(TGLWidget* glWidget, Bool_t shareDefault = kTRUE, const TGLContext* shareList = 0)
virtual~TGLContext()
static TClass*Class()
Bool_tClearCurrent()
static TGLContext*GetCurrent()
TGLContextIdentity*GetIdentity() const
static voidGlewInit()
virtual TClass*IsA() const
Bool_tIsValid() const
Bool_tMakeCurrent()
voidRelease()
voidSetContext(TGLWidget* widget, const TGLContext* shareList)
virtual voidShowMembers(TMemberInspector& insp)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
voidSwapBuffers()

Data Members

private:
TGLPaintDevice*fDevice
Bool_tfFromCtorTo prohibit user's calls of SetContext.
TGLContextIdentity*fIdentity
TGLContextPrivate*fPimpl
Bool_tfValid
static Bool_tfgGlewInitDone

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TGLContext(TGLWidget* glWidget, Bool_t shareDefault = kTRUE, const TGLContext* shareList = 0)
 TGLContext ctor "from" TGLWidget.
 Is shareDefault is true, the shareList is set from default
 context-identity. Otherwise the given shareList is used (can be
 null).
 Makes thread switching.
void GlewInit()
 Initialize GLEW - static private function.
 Called immediately after creation of the first GL context.
void SetContext(TGLWidget* widget, const TGLContext* shareList)
WIN32 gl-context creation. Defined as a member-function (this code removed from ctor)
to make WIN32/X11 separation cleaner.
This function is public only for calls via gROOT and called from ctor.
Bool_t MakeCurrent()
If context is valid (TGLPaintDevice, for which context was created still exists),
make it current.
Bool_t ClearCurrent()
Reset current context.
void SwapBuffers()
If context is valid (TGLPaintDevice, for which context was created still exists),
swap buffers (in case of P-buffer call glFinish()).
void Release()
Make the context invalid and (do thread switch, if needed)
free resources.
~TGLContext()
TGLContext dtor. If it's called before TGLPaintDevice's dtor
(context is valid) resource will be freed and context
un-registered.
TGLContextIdentity * GetIdentity() const
We can have several shared contexts,
and gl-scene wants to know, if some context
(defined by its identity) can be used.
TGLContext * GetCurrent()
Ask TGLContextPrivate to lookup context in its internal map.
TGLContext(TGLWidget* glWidget, Bool_t shareDefault = kTRUE, const TGLContext* shareList = 0)
   TGLContext(TGLPBuffer *glPbuf, const TGLContext *shareList = 0);
Bool_t IsValid() const
{ return fValid; }