The OpenGL context API interface that is used by the OpenGL backend to interact with the platform. More...
#include <kanzi/platform/platform/gl/common/gl_graphics_context.hpp>
Classes | |
| struct | InitializationInfo |
| The initialization parameters for the OpenGL context API. More... | |
| struct | SurfaceContextHandle |
| The SurfaceContext handle is used to identify an OpenGL context that is used by the rendering thread. More... | |
| struct | SurfaceHandle |
| The Surface handle is used to identify a platform surface that can be used as a target for OpenGL rendering. More... | |
| struct | ThreadContextHandle |
| The ThreadContext handle is used to identify an OpenGL context that is used by user threads to perform OpenGL operations on behalf of the rendering thread. More... | |
Public Member Functions | |
| virtual SurfaceHandle | createSurface (NativeSurfaceHandle windowHandle, const SurfaceProperties &properties)=0 |
| Creates a new Surface, potentially a new GL Context for the surface. | |
| virtual ThreadContextHandle | createThreadContext ()=0 |
| Creates a new headless OpenGL context that is shared with the default context. | |
| virtual bool | destroySurface (SurfaceHandle surface)=0 |
| Destroy a created SurfaceHandle. | |
| virtual void | destroyThreadContext (ThreadContextHandle context)=0 |
| Destroys the Thread context. | |
| virtual SurfaceContextHandle | getCurrentSurfaceContext ()=0 |
| Gets the currently active SurfaceContextHandle. | |
| virtual void * | getGLProcAddress (const char *name)=0 |
| Gets the address of an OpenGL entry point. | |
| template<typename Return , typename... Args> | |
| bool | getGLProcAddressInto (function_ptr< Return, Args... > &proc, const char *pName) |
| Dynamically loads a GL function pointer into specified location. | |
| virtual SurfaceContextHandle | getSurfaceGLContext (SurfaceHandle surface)=0 |
| Gets the SurfaceContextHandle associated with the given surface. | |
| virtual SurfaceProperties | getSurfaceProperties (SurfaceHandle surface)=0 |
| Gets the SurfaceProperties for a given SurfaceHandle object. | |
| virtual vector< SurfaceHandle > | getSurfaces (SurfaceContextHandle context)=0 |
| Gets the surfaces associated with a context. | |
| virtual bool | initialize ()=0 |
| Initializes the OpenGL context API and creates a default headless SurfaceContext that can be used for off screen rendering. | |
| virtual bool | isFeatureEnabled (PlatformFeatureId feature) const =0 |
| Tests if a platform FeatureId is enabled on the current platform. | |
| virtual void | makeSurfaceCurrent (SurfaceHandle surface)=0 |
| Makes the requested SurfaceHandle current. | |
| virtual void | makeThreadCurrent (ThreadContextHandle context)=0 |
| Makes the ThreadContextHandle active on the current thread. | |
| virtual void | shutdown ()=0 |
| Shuts down the OpenGL context API. | |
| virtual bool | swapBuffers (SurfaceHandle surface)=0 |
| Swaps the buffers associated with the SurfaceHandle. | |
| virtual | ~GlGraphicsContext ()=default |
| Destructor. | |
The OpenGL context API interface that is used by the OpenGL backend to interact with the platform.
|
virtualdefault |
Destructor.
Initializes the OpenGL context API and creates a default headless SurfaceContext that can be used for off screen rendering.
The newly created context is made current on the calling thread.
Implemented in kanzi::platform::EglGraphicsContext, kanzi::platform::GlxGraphicsContext, and kanzi::platform::WglGraphicsContext.
Shuts down the OpenGL context API.
This will invalidate all SurfaceHandle, SurfaceContextHandle, and ThreadContextHandle instances. After this call, it is possible to call initialize() again.
Implemented in kanzi::platform::EglGraphicsContext, kanzi::platform::GlxGraphicsContext, and kanzi::platform::WglGraphicsContext.
|
pure virtual |
Swaps the buffers associated with the SurfaceHandle.
| surface | The surface will be swapped. |
Implemented in kanzi::platform::EglGraphicsContext, kanzi::platform::EglOhosGraphicsContext, kanzi::platform::EglQnxStreamsGraphicsContext, kanzi::platform::GlxGraphicsContext, and kanzi::platform::WglGraphicsContext.
|
pure virtual |
Creates a new headless OpenGL context that is shared with the default context.
Implemented in kanzi::platform::EglGraphicsContext, kanzi::platform::GlxGraphicsContext, and kanzi::platform::WglGraphicsContext.
|
pure virtual |
Destroys the Thread context.
| context | The thread context to be destroyed. |
Implemented in kanzi::platform::EglGraphicsContext, kanzi::platform::GlxGraphicsContext, and kanzi::platform::WglGraphicsContext.
|
pure virtual |
Creates a new Surface, potentially a new GL Context for the surface.
Also calls makeSurfaceCurrent on the new surface.
If the default context is compatible with this surface, the default context should be used. If a new context is required, the OpenGL backend will still function, but may result in reduced performance.
| windowHandle | Opaque platform specific window handle. |
| properties | The requested surface properties. |
Implemented in kanzi::platform::EglGraphicsContext, kanzi::platform::GlxGraphicsContext, and kanzi::platform::WglGraphicsContext.
|
pure virtual |
Destroy a created SurfaceHandle.
| surface | The surface handle to destroy. |
Implemented in kanzi::platform::EglGraphicsContext, kanzi::platform::GlxGraphicsContext, and kanzi::platform::WglGraphicsContext.
|
pure virtual |
Gets the SurfaceProperties for a given SurfaceHandle object.
| surface | The surface handle to query. |
Implemented in kanzi::platform::EglGraphicsContext, kanzi::platform::GlxGraphicsContext, and kanzi::platform::WglGraphicsContext.
|
pure virtual |
Gets the SurfaceContextHandle associated with the given surface.
If the SurfaceHandle is the empty surface, the SurfaceContextHandle for the default context is returned.
| surface | The surface handle. |
Implemented in kanzi::platform::EglGraphicsContext, kanzi::platform::GlxGraphicsContext, and kanzi::platform::WglGraphicsContext.
|
pure virtual |
Makes the requested SurfaceHandle current.
If the surface is the empty surface, the default context is made active. If a compatible context is already active, no changes are made.
| surface | The surface handle to make current. |
Implemented in kanzi::platform::EglGraphicsContext, kanzi::platform::GlxGraphicsContext, and kanzi::platform::WglGraphicsContext.
|
pure virtual |
Gets the currently active SurfaceContextHandle.
Implemented in kanzi::platform::EglGraphicsContext, kanzi::platform::GlxGraphicsContext, and kanzi::platform::WglGraphicsContext.
|
pure virtual |
Gets the surfaces associated with a context.
| context | The context to query. |
Implemented in kanzi::platform::EglGraphicsContext, kanzi::platform::GlxGraphicsContext, and kanzi::platform::WglGraphicsContext.
|
pure virtual |
Gets the address of an OpenGL entry point.
| name | The name of the entry point. |
Implemented in kanzi::platform::EglGraphicsContext, kanzi::platform::GlxGraphicsContext, and kanzi::platform::WglGraphicsContext.
|
inline |
Dynamically loads a GL function pointer into specified location.
| Return | GL function return type. |
| Args | GL function argument types. |
| proc | Out parameter for GL function pointer. |
| pName | GL function name. |
|
pure virtual |
Makes the ThreadContextHandle active on the current thread.
Must be on non-rendering threads.
Calling makeThreadCurrent with a default constructed ThreadContextHandle will release the context from the current thread and leave no context current.
| context | The thread context to make current. |
Implemented in kanzi::platform::EglGraphicsContext, kanzi::platform::GlxGraphicsContext, and kanzi::platform::WglGraphicsContext.
|
pure virtual |
Tests if a platform FeatureId is enabled on the current platform.
| feature | The FeatureId to test. |
Implemented in kanzi::platform::EglGraphicsContext, kanzi::platform::GlxGraphicsContext, and kanzi::platform::WglGraphicsContext.