An opaque handle to an OpenGL context.
More...
|
|
constexpr | GLContext (std::nullptr_t=nullptr) noexcept |
| | Default ctor.
|
| |
| constexpr | GLContext (const GLContextRaw resource) noexcept |
| | Constructs from GLContextParam. More...
|
| |
|
constexpr | GLContext (const GLContext &other) noexcept=default |
| | Copy constructor.
|
| |
|
constexpr | GLContext (GLContext &&other) noexcept |
| | Move constructor.
|
| |
| | GLContext (WindowParam window) |
| | Create an OpenGL context for an OpenGL window, and make it current. More...
|
| |
|
| ~GLContext () |
| | Destructor.
|
| |
|
constexpr GLContext & | operator= (GLContext &&other) noexcept |
| | Assignment operator.
|
| |
|
constexpr GLContext & | operator= (const GLContext &other) noexcept=default |
| | Assignment operator.
|
| |
|
constexpr GLContextRaw | get () const noexcept |
| | Retrieves underlying GLContextRaw.
|
| |
|
constexpr GLContextRaw | release () noexcept |
| | Retrieves underlying GLContextRaw and clear this.
|
| |
|
constexpr auto | operator<=> (const GLContext &other) const noexcept=default |
| | Comparison.
|
| |
|
constexpr | operator bool () const noexcept |
| | Converts to bool.
|
| |
|
constexpr | operator GLContextParam () const noexcept |
| | 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...
|
| |
◆ GLContext() [1/2]
| constexpr SDL::GLContext::GLContext |
( |
const GLContextRaw |
resource | ) |
|
|
inlineconstexprnoexcept |
- Parameters
-
| resource | a GLContextRaw to be wrapped. |
◆ GLContext() [2/2]
The OpenGL context will be created with the current states set through GL_SetAttribute().
The Window specified must have been created with the WINDOW_OPENGL flag, or context creation will fail.
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: