An opaque handle to an OpenGL context.
More...
|
void | MakeCurrent (WindowRef window) |
| Set up an OpenGL context for rendering into an OpenGL window.
|
|
constexpr | Resource (T resource={}) |
| Constructs from the underlying resource.
|
|
constexpr | Resource (const ResourceHandle< Resource< T > > auto &resource) |
| Constructs from pointer like.
|
|
constexpr | Resource (std::nullptr_t) |
| Equivalent to default ctor.
|
|
constexpr | Resource (std::nullopt_t) |
| Equivalent to default ctor.
|
|
constexpr | Resource (SDL_GLContextState * resource={}) |
| Constructs from the underlying resource.
|
|
constexpr | Resource (const ResourceHandle< Resource< SDL_GLContextState * > > auto &resource) |
| Constructs from pointer like.
|
|
constexpr | Resource (std::nullptr_t) |
| Equivalent to default ctor.
|
|
constexpr | Resource (std::nullopt_t) |
| Equivalent to default ctor.
|
|
constexpr | operator bool () const |
| True if contains a valid resource.
|
|
constexpr | operator value_type () const |
| Converts back to underlying type.
|
|
constexpr bool | operator== (const Resource &other) const=default |
| Comparison.
|
|
constexpr bool | operator== (std::nullopt_t) const |
| Comparison.
|
|
constexpr bool | operator== (std::nullptr_t) const |
| Comparison.
|
|
constexpr SDL_GLContextState * | get () const |
| Return contained resource;.
|
|
constexpr const SDL_GLContextState * | operator-> () const |
| Access to fields.
|
|
constexpr SDL_GLContextState * | operator-> () |
| Access to fields.
|
|
|
static void | reset (SDL_GLContextState *resource) |
| Delete an OpenGL context.
|
|
|
using | value_type = SDL_GLContextState * |
| The raw resource type.
|
|
- Since
- This datatype is available since SDL 3.2.0.
- Category:
- Resource
- See also
- GLContext.Create
-
GLContext
◆ MakeCurrent()
void SDL::GLContextRef::MakeCurrent |
( |
WindowRef |
window | ) |
|
|
inline |
The context must have been created with a compatible window.
- Parameters
-
window | the window to associate with the context. |
- Exceptions
-
- 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.GLContext
◆ reset()
static void SDL::GLContextRef::reset |
( |
SDL_GLContextState * |
resource | ) |
|
|
inlinestatic |
- Parameters
-
resource | the OpenGL context to be deleted. |
- Exceptions
-
- 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.Create
The documentation for this struct was generated from the following file: