![]() |
ImFusion SDK 4.3
|
#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. | |
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.
|
pure virtual |
Make context current.
Implemented in ContextGLX, ContextWindows, and GlContextQt.
|
pure virtual |
Disable context.
Implemented in ContextGLX, ContextWindows, and GlContextQt.
|
pure virtual |
Returns the native handle of this OpenGL context that can be used with CreateInfo::shareContext
.
Implemented in ContextGLX, ContextWindows, and 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 ContextGLX, ContextWindows, and GlContextQt.
|
virtual |
Removes the binding of the OpenGL context to the current (i.e., calling) thread.
Reimplemented in GlContextQt.
|
virtual |
Moves the OpenGL context to the current (i.e., calling) thread.
Reimplemented in GlContextQt.
|
protectedvirtual |
Clean up internal resources attached to this context.
Derived classes must call this function in their destructor before destroying the GL context.