All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GlfGLContext Class Referenceabstract

Provides window system independent access to GL contexts. More...

+ Inheritance diagram for GlfGLContext:

Public Member Functions

 GlfGLContext (const GlfGLContext &)=delete
 
GlfGLContextoperator= (const GlfGLContext &)=delete
 
GLF_API bool IsCurrent () const
 Returns true if this context is current. More...
 
GLF_API bool IsSharing (GlfGLContextSharedPtr const &otherContext)
 Returns true if this context is sharing with otherContext. More...
 
virtual bool IsValid () const =0
 Returns true if this context is valid. More...
 
virtual GlfGLContextSharedPtr CreateSharingContext ()
 Creates a new GlfContext that shares GL resources with this context. More...
 

Static Public Member Functions

static GLF_API
GlfGLContextSharedPtr 
GetCurrentGLContext ()
 Returns an instance for the current GL context. More...
 
static GLF_API
GlfGLContextSharedPtr 
GetSharedGLContext ()
 Returns an instance for the shared GL context. More...
 
static GLF_API void MakeCurrent (const GlfGLContextSharedPtr &context)
 Makes context current if valid, otherwise makes no context current. More...
 
static GLF_API bool AreSharing (GlfGLContextSharedPtr const &context1, GlfGLContextSharedPtr const &context2)
 Returns true if context1 and context2 are sharing. More...
 
static GLF_API bool IsInitialized ()
 Returns whether this interface has been initialized. More...
 
static GLF_API void DoneCurrent ()
 Makes no context current. More...
 

Protected Member Functions

virtual void _MakeCurrent ()=0
 Makes this context current. More...
 
virtual bool _IsSharing (const GlfGLContextSharedPtr &rhs) const =0
 Returns true if this context is sharing with rhs. More...
 
virtual bool _IsEqual (const GlfGLContextSharedPtr &rhs) const =0
 Returns true if this context is equal to rhs. More...
 

Detailed Description

Provides window system independent access to GL contexts.

All OpenGL operation occurs within a current GL Context. The GL contexts used by an application are allocated and managed by the window system interface layer, i.e. Qt, GLUT, GLX, etc.

This class provides a way for lower-level OpenGL framework code to get useful information about the GL contexts in use by the application.

This mechanism depends on the application code registering callbacks to provide access to its GL contexts.

Definition at line 52 of file glContext.h.

Member Function Documentation

virtual bool _IsEqual ( const GlfGLContextSharedPtr &  rhs) const
protectedpure virtual

Returns true if this context is equal to rhs.

Implemented in GlfTestGLContext.

virtual bool _IsSharing ( const GlfGLContextSharedPtr &  rhs) const
protectedpure virtual

Returns true if this context is sharing with rhs.

Implemented in GlfTestGLContext.

virtual void _MakeCurrent ( )
protectedpure virtual

Makes this context current.

Implemented in GlfTestGLContext.

static GLF_API bool AreSharing ( GlfGLContextSharedPtr const &  context1,
GlfGLContextSharedPtr const &  context2 
)
static

Returns true if context1 and context2 are sharing.

virtual GlfGLContextSharedPtr CreateSharingContext ( )
inlinevirtual

Creates a new GlfContext that shares GL resources with this context.

The purpose of this function is to be able to create a new GL context on a second thread that shares with the context on the main-thread. If the GlfContext implementation does not support sharing contexts null is returned. Example usage: Main-thread: RegisterGLContextCallbacks(); GlfGLContext::MakeCurrent(...); Second-thread: s = GetCurrentGLContext(); c = s->CreateSharingContext();

Definition at line 116 of file glContext.h.

static GLF_API void DoneCurrent ( )
static

Makes no context current.

static GLF_API GlfGLContextSharedPtr GetCurrentGLContext ( )
static

Returns an instance for the current GL context.

static GLF_API GlfGLContextSharedPtr GetSharedGLContext ( )
static

Returns an instance for the shared GL context.

GLF_API bool IsCurrent ( ) const

Returns true if this context is current.

static GLF_API bool IsInitialized ( )
static

Returns whether this interface has been initialized.

GLF_API bool IsSharing ( GlfGLContextSharedPtr const &  otherContext)

Returns true if this context is sharing with otherContext.

virtual bool IsValid ( ) const
pure virtual

Returns true if this context is valid.

Implemented in GlfTestGLContext.

static GLF_API void MakeCurrent ( const GlfGLContextSharedPtr &  context)
static

Makes context current if valid, otherwise makes no context current.


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