The OpenGL platform interface that is used by the OpenGL backend to interact with the platform. More...
#include <kanzi/platform/platform/context/opengl_platform.hpp>
Classes | |
| struct | InitializationInfo |
| The initialization parameters for the OpenGL platform. 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 * | getOGLProcAddress (const char *name)=0 |
| Gets the address of an OpenGL entry point. | |
| 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 void | initializePlatform ()=0 |
| Initializes the OpenGL Platform API and creates a default headless SurfaceContext that can be used for off screen rendering. | |
| virtual bool | isFeatureEnabled (PlatformFeatureId feature)=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 | shutdownPlatform ()=0 |
| Shuts down the OpenGL platform API. | |
| virtual bool | swapBuffers (SurfaceHandle surface)=0 |
| Swaps the buffers associated with the SurfaceHandle. | |
| virtual | ~OpenGLPlatform ()=default |
| Destructor. | |
The OpenGL platform interface that is used by the OpenGL backend to interact with the platform.
|
virtualdefault |
Destructor.
Initializes the OpenGL Platform 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.
Shuts down the OpenGL platform API.
This will invalidate all SurfaceHandle, SurfaceContextHandle, and ThreadContextHandle instances. After this call, it is possible to call initializePlatform again.
|
pure virtual |
Swaps the buffers associated with the SurfaceHandle.
| surface | The surface will be swapped. |
|
pure virtual |
Creates a new headless OpenGL context that is shared with the default context.
|
pure virtual |
Destroys the Thread context.
| context | The thread context to be destroyed. |
|
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. |
|
pure virtual |
Destroy a created SurfaceHandle.
| surface | The surface handle to destroy. |
|
pure virtual |
Gets the SurfaceProperties for a given SurfaceHandle object.
| surface | The surface handle to query. |
|
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. |
|
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. |
|
pure virtual |
Gets the currently active SurfaceContextHandle.
|
pure virtual |
Gets the surfaces associated with a context.
| context | The context to query. |
Gets the address of an OpenGL entry point.
| name | The name of the entry point. |
|
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. |
|
pure virtual |
Tests if a platform FeatureId is enabled on the current platform.
| feature | The FeatureId to test. |