Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGLContext Class Reference

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

Definition at line 30 of file TGLContext.h.

Public Member Functions

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

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static TGLContextGetCurrent ()
 Ask TGLContextPrivate to lookup context in its internal map.
 
static void GlewInit ()
 Initialize GLEW - static private function.
 

Private Member Functions

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

Private Attributes

TGLPaintDevicefDevice
 
Bool_t fFromCtor
 
TGLContextIdentityfIdentity
 
std::unique_ptr< TGLContextPrivatefPimpl
 
Bool_t fValid
 

Static Private Attributes

static Bool_t fgGlewInitDone = kFALSE
 

Friends

class TGLContextPrivate
 
class TGLWidget
 

#include <TGLContext.h>

Constructor & Destructor Documentation

◆ TGLContext() [1/2]

TGLContext::TGLContext ( TGLWidget wid,
Bool_t  shareDefault = kTRUE,
const TGLContext shareList = nullptr 
)

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 52 of file TGLContext.cxx.

◆ ~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 429 of file TGLContext.cxx.

◆ TGLContext() [2/2]

TGLContext::TGLContext ( const TGLContext )
private

Member Function Documentation

◆ Class()

static TClass * TGLContext::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * TGLContext::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static constexpr Version_t TGLContext::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 74 of file TGLContext.h.

◆ ClearCurrent()

Bool_t TGLContext::ClearCurrent ( )

Reset current context.

Definition at line 387 of file TGLContext.cxx.

◆ DeclFileName()

static const char * TGLContext::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 74 of file TGLContext.h.

◆ GetCurrent()

TGLContext * TGLContext::GetCurrent ( )
static

Ask TGLContextPrivate to lookup context in its internal map.

Definition at line 452 of file TGLContext.cxx.

◆ 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 444 of file TGLContext.cxx.

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

◆ IsA()

virtual TClass * TGLContext::IsA ( ) const
inlinevirtual
Returns
TClass describing current object

Definition at line 74 of file TGLContext.h.

◆ IsValid()

Bool_t TGLContext::IsValid ( ) const
inline

Definition at line 65 of file TGLContext.h.

◆ MakeCurrent()

Bool_t TGLContext::MakeCurrent ( )

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

Definition at line 363 of file TGLContext.cxx.

◆ operator=()

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

◆ Release()

void TGLContext::Release ( )

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

Definition at line 413 of file TGLContext.cxx.

◆ 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 330 of file TGLContext.cxx.

◆ Streamer()

virtual void TGLContext::Streamer ( TBuffer )
virtual

◆ StreamerNVirtual()

void TGLContext::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 74 of file TGLContext.h.

◆ 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 396 of file TGLContext.cxx.

Friends And Related Symbol Documentation

◆ TGLContextPrivate

friend class TGLContextPrivate
friend

Definition at line 32 of file TGLContext.h.

◆ TGLWidget

friend class TGLWidget
friend

Definition at line 33 of file TGLContext.h.

Member Data Documentation

◆ fDevice

TGLPaintDevice* TGLContext::fDevice
private

Definition at line 37 of file TGLContext.h.

◆ fFromCtor

Bool_t TGLContext::fFromCtor
private

Definition at line 40 of file TGLContext.h.

◆ fgGlewInitDone

Bool_t TGLContext::fgGlewInitDone = kFALSE
staticprivate

Definition at line 45 of file TGLContext.h.

◆ fIdentity

TGLContextIdentity* TGLContext::fIdentity
private

Definition at line 43 of file TGLContext.h.

◆ fPimpl

std::unique_ptr<TGLContextPrivate> TGLContext::fPimpl
private

Definition at line 38 of file TGLContext.h.

◆ fValid

Bool_t TGLContext::fValid
private

Definition at line 41 of file TGLContext.h.

Libraries for TGLContext:

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