ROOT  6.06/08
Reference Guide
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
TGLContext Class Reference

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

Definition at line 33 of file TGLContext.h.

Public Member Functions

 TGLContext (TGLWidget *glWidget, Bool_t shareDefault=kTRUE, const TGLContext *shareList=0)
 TGLContext ctor "from" TGLWidget. More...
 
TGLContextIdentityGetIdentity () const
 We can have several shared contexts, and gl-scene wants to know, if some context (defined by its identity) can be used. More...
 
virtual ~TGLContext ()
 TGLContext dtor. More...
 
Bool_t MakeCurrent ()
 If context is valid (TGLPaintDevice, for which context was created still exists), make it current. More...
 
Bool_t ClearCurrent ()
 Reset current context. More...
 
void SwapBuffers ()
 If context is valid (TGLPaintDevice, for which context was created still exists), swap buffers (in case of P-buffer call glFinish()). More...
 
void SetContext (TGLWidget *widget, const TGLContext *shareList)
 X11 gl-context creation. More...
 
void Release ()
 Make the context invalid and (do thread switch, if needed) free resources. More...
 
Bool_t IsValid () const
 

Static Public Member Functions

static TGLContextGetCurrent ()
 Ask TGLContextPrivate to lookup context in its internal map. More...
 
static void GlewInit ()
 Initialize GLEW - static private function. More...
 

Private Member Functions

 TGLContext (const TGLContext &)
 
TGLContextoperator= (const TGLContext &)
 

Private Attributes

TGLPaintDevicefDevice
 
TGLContextPrivatefPimpl
 
Bool_t fFromCtor
 
Bool_t fValid
 
TGLContextIdentityfIdentity
 

Static Private Attributes

static Bool_t fgGlewInitDone = kFALSE
 

Friends

class TGLContextPrivate
 
class TGLWidget
 

#include <TGLContext.h>

+ Collaboration diagram for TGLContext:

Constructor & Destructor Documentation

§ TGLContext() [1/2]

TGLContext::TGLContext ( TGLWidget wid,
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.

Definition at line 51 of file TGLContext.cxx.

Referenced by IsValid().

§ ~TGLContext()

TGLContext::~TGLContext ( )
virtual

TGLContext dtor.

If it's called before TGLPaintDevice's dtor (context is valid) resource will be freed and context un-registered.

Definition at line 434 of file TGLContext.cxx.

§ TGLContext() [2/2]

TGLContext::TGLContext ( const TGLContext )
private

Member Function Documentation

§ ClearCurrent()

Bool_t TGLContext::ClearCurrent ( )

Reset current context.

Definition at line 392 of file TGLContext.cxx.

Referenced by TGLWidget::ClearCurrent(), and GlewInit().

§ GetCurrent()

TGLContext * TGLContext::GetCurrent ( )
static

Ask TGLContextPrivate to lookup context in its internal map.

Definition at line 459 of file TGLContext.cxx.

Referenced by TGLContextIdentity::GetCurrent(), IsValid(), and TGLContextIdentity::IsValid().

§ GetIdentity()

TGLContextIdentity * TGLContext::GetIdentity ( ) const

We can have several shared contexts, and gl-scene wants to know, if some context (defined by its identity) can be used.

Definition at line 451 of file TGLContext.cxx.

Referenced by TGLContextIdentity::GetCurrent(), and TGLContext().

§ GlewInit()

void TGLContext::GlewInit ( )
static

Initialize GLEW - static private function.

Called immediately after creation of the first GL context.

Definition at line 86 of file TGLContext.cxx.

Referenced by IsValid(), and MakeCurrent().

§ IsValid()

Bool_t TGLContext::IsValid ( ) const
inline

§ MakeCurrent()

Bool_t TGLContext::MakeCurrent ( )

If context is valid (TGLPaintDevice, for which context was created still exists), make it current.

Definition at line 368 of file TGLContext.cxx.

Referenced by GlewInit(), TGLWidget::MakeCurrent(), and TGLPaintDevice::~TGLPaintDevice().

§ operator=()

TGLContext& TGLContext::operator= ( const TGLContext )
private

Referenced by IsValid().

§ Release()

void TGLContext::Release ( )

Make the context invalid and (do thread switch, if needed) free resources.

Definition at line 418 of file TGLContext.cxx.

Referenced by GlewInit(), and ~TGLContext().

§ SetContext()

void TGLContext::SetContext ( TGLWidget widget,
const TGLContext shareList 
)

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

Definition at line 333 of file TGLContext.cxx.

Referenced by GlewInit(), and TGLContext().

§ SwapBuffers()

void TGLContext::SwapBuffers ( )

If context is valid (TGLPaintDevice, for which context was created still exists), swap buffers (in case of P-buffer call glFinish()).

Definition at line 401 of file TGLContext.cxx.

Referenced by GlewInit(), TGLWidget::SwapBuffers(), and TGLPaintDevice::~TGLPaintDevice().

Friends And Related Function Documentation

§ TGLContextPrivate

friend class TGLContextPrivate
friend

Definition at line 35 of file TGLContext.h.

§ TGLWidget

friend class TGLWidget
friend

Definition at line 36 of file TGLContext.h.

Member Data Documentation

§ fDevice

TGLPaintDevice* TGLContext::fDevice
private

Definition at line 40 of file TGLContext.h.

Referenced by GlewInit(), SetContext(), and ~TGLContext().

§ fFromCtor

Bool_t TGLContext::fFromCtor
private

Definition at line 43 of file TGLContext.h.

Referenced by GlewInit(), SetContext(), and TGLContext().

§ fgGlewInitDone

Bool_t TGLContext::fgGlewInitDone = kFALSE
staticprivate

Definition at line 48 of file TGLContext.h.

Referenced by GlewInit(), and MakeCurrent().

§ fIdentity

TGLContextIdentity* TGLContext::fIdentity
private

Definition at line 46 of file TGLContext.h.

Referenced by GetIdentity(), GlewInit(), MakeCurrent(), TGLContext(), and ~TGLContext().

§ fPimpl

TGLContextPrivate* TGLContext::fPimpl
private

§ fValid

Bool_t TGLContext::fValid
private

Definition at line 44 of file TGLContext.h.

Referenced by GlewInit(), IsValid(), MakeCurrent(), Release(), SetContext(), SwapBuffers(), and ~TGLContext().


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