|
SDL3pp
A slim C++ wrapper for SDL3
|
RAII owning version GLContext. More...
Public Member Functions | |
| constexpr | GLContextScoped (const GLContextScoped &other)=delete |
| constexpr | GLContextScoped (GLContextScoped &&other) noexcept |
| Move constructor. | |
| constexpr | GLContextScoped (GLContext &&other) noexcept |
| Move constructor. | |
| ~GLContextScoped () | |
| Destructor. | |
| GLContext (WindowRef window) | |
| Create an OpenGL context for an OpenGL window, and make it current. | |
| Public Member Functions inherited from SDL::GLContext | |
| GLContext (WindowRef window) | |
| Create an OpenGL context for an OpenGL window, and make it current. | |
| constexpr | operator GLContextRaw () const noexcept |
| Converts to underlying GLContextRaw. | |
| void | Destroy () |
| Delete an OpenGL context. | |
| void | MakeCurrent (WindowRef window) |
| Set up an OpenGL context for rendering into an OpenGL window. | |
| constexpr | ResourceBase (RawPointer resource) |
| Constructs from resource pointer. | |
| constexpr | ResourceBase (std::nullptr_t=nullptr) |
| Constructs null/invalid. | |
| Public Member Functions inherited from SDL::ResourceBase< GLContextRaw > | |
| constexpr | ResourceBase (RawPointer resource) |
| Constructs from resource pointer. | |
| constexpr | operator bool () const |
| Converts to bool. | |
| constexpr auto | operator<=> (const ResourceBase &other) const=default |
| Comparison. | |
| constexpr RawConstPointer | operator-> () const noexcept |
| member access to underlying resource pointer. | |
| constexpr RawPointer | get () const noexcept |
| Retrieves underlying resource pointer. | |
| constexpr RawPointer | release () noexcept |
| Retrieves underlying resource pointer and clear this. | |
Additional Inherited Members | |
| Public Types inherited from SDL::ResourceBase< GLContextRaw > | |
| using | RawPointer |
| The underlying raw pointer type. | |
| using | RawConstPointer |
| The underlying const raw pointer type. | |
RAII owning version GLContext.
|
inline |
Create an OpenGL context for an OpenGL window, and make it current.
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.
| window | the window to associate with the context. |