An opaque handle to an OpenGL context.
More...
|
|
constexpr | GLContext ()=default |
| | Default ctor.
|
| |
| constexpr | GLContext (const GLContextRaw resource) |
| | Constructs from GLContextParam. More...
|
| |
|
constexpr | GLContext (const GLContext &other)=default |
| | Copy constructor.
|
| |
|
constexpr | GLContext (GLContext &&other) |
| | Move constructor.
|
| |
| | GLContext (WindowParam window) |
| | Create an OpenGL context for an OpenGL window, and make it current. More...
|
| |
|
| ~GLContext () |
| | Destructor.
|
| |
|
GLContext & | operator= (GLContext other) |
| | Assignment operator.
|
| |
|
constexpr GLContextRaw | get () const |
| | Retrieves underlying GLContextRaw.
|
| |
|
constexpr GLContextRaw | release () |
| | Retrieves underlying GLContextRaw and clear this.
|
| |
|
constexpr auto | operator<=> (const GLContext &other) const =default |
| | Comparison.
|
| |
|
constexpr bool | operator== (std::nullptr_t _) const |
| | Comparison.
|
| |
|
constexpr | operator bool () const |
| | Converts to bool.
|
| |
|
constexpr | operator GLContextParam () const |
| | Converts to GLContextParam.
|
| |
| void | Destroy () |
| | Delete an OpenGL context. More...
|
| |
| void | MakeCurrent (WindowParam window) |
| | Set up an OpenGL context for rendering into an OpenGL window. More...
|
| |
- Since
- This datatype is available since SDL 3.2.0.
- See also
- GLContext.GLContext
- Category:
- Resource
◆ GLContext() [1/2]
| constexpr SDL::GLContext::GLContext |
( |
const GLContextRaw |
resource | ) |
|
|
inlineconstexpr |
- Parameters
-
| resource | a GLContextRaw to be wrapped. |
◆ GLContext() [2/2]
Windows users new to OpenGL should note that, for historical reasons, GL functions added after OpenGL version 1.1 are not available by default. Those functions must be loaded at run-time, either with an OpenGL extension-handling library or with GL_GetProcAddress() and its related functions.
GLContext is opaque to the application.
- Parameters
-
| window | the window to associate with the context. |
- Postcondition
- the OpenGL context associated with
window or nullptr on failure; call GetError() for more information.
- Thread safety:
- This function should only be called on the main thread.
- Since
- This function is available since SDL 3.2.0.
- See also
- GLContext.Destroy
-
GLContext.MakeCurrent
The documentation for this class was generated from the following file: