![]() |
ImFusion C++ SDK 4.5.0
|
#include <ImFusion/Core/GL/Context.h>
Base class for low-level OpenGL context handling within the ImFusion SDK. More...
Base class for low-level OpenGL context handling within the ImFusion SDK.
The child classes implement the concrete platform-specific code (based on WGL, GLX, etc.).
For very barebone applications, you can use the static create() factory function to create a GL::Context instance matching your local platform:
Classes | |
| struct | CreateInfo |
Public Member Functions | |
| virtual bool | makeCurrent () const =0 |
| Make context current. | |
| virtual bool | doneCurrent () const =0 |
| Disable context. | |
| virtual void * | internalHandle () const =0 |
| Returns the native handle of this OpenGL context that can be used with CreateInfo::shareContext. | |
| virtual std::unique_ptr< Context > | clone ()=0 |
| Instantiates a new OpenGL context that is shared with this one. | |
| virtual void | detachFromCurrentThread () |
| Removes the binding of the OpenGL context to the current (i.e., calling) thread. | |
| virtual void | moveToCurrentThread () |
| Moves the OpenGL context to the current (i.e., calling) thread. | |
Static Public Member Functions | |
| static std::unique_ptr< Context > | create (CreateInfo createInfo) |
| Factory function for creating a new offscreen OpenGL context. | |
| static bool | hasCurrent () |
| Returns whether the calling thread has a current OpenGL context. | |
| static void * | currentContextId () |
| Returns a platform-specific handle to the currently active OpenGL context. | |
Protected Member Functions | |
| virtual void | deinitialize () |
| Clean up internal resources attached to this context. | |
Static Protected Member Functions | |
| static int | defaultPixelBufferSize () |
| Default width and height of the pixel buffer of newly created offscreen contexts. | |
| static void | installDefaultDebugMessageHandler () |
| Sets up the Debug::defaultMessageCallback handler. | |
|
static |
Factory function for creating a new offscreen OpenGL context.
The freshly created context will be made current. The derived class of the returned object is platform dependent.
On Linux, multiple backends are supported which can be changed by setting the IMFUSION_GL_BACKEND environment variable. Possible values are 'glx' and 'egl'. If the variable is empty, 'glx' is used by default.
|
static |
Returns a platform-specific handle to the currently active OpenGL context.
|
pure virtual |
Make context current.
Implemented in ImFusion::GlContextQt.
|
pure virtual |
Disable context.
Implemented in ImFusion::GlContextQt.
|
pure virtual |
Returns the native handle of this OpenGL context that can be used with CreateInfo::shareContext.
Implemented in ImFusion::GlContextQt.
|
pure virtual |
Instantiates a new OpenGL context that is shared with this one.
The freshly created context will be made current. This method will throw if the context could not be initialized.
Implemented in ImFusion::GlContextQt.
|
virtual |
Removes the binding of the OpenGL context to the current (i.e., calling) thread.
Reimplemented in ImFusion::GlContextQt.
|
virtual |
Moves the OpenGL context to the current (i.e., calling) thread.
Reimplemented in ImFusion::GlContextQt.
|
protectedvirtual |
Clean up internal resources attached to this context.
Derived classes must call this function in their destructor before destroying the GL context.