SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::GLContextScoped Struct Reference

RAII owning version GLContext.

Inheritance diagram for SDL::GLContextScoped:
Inheritance graph
[legend]
Collaboration diagram for SDL::GLContextScoped:
Collaboration graph
[legend]

Public Member Functions

constexpr GLContextScoped (const GLContext &other)=delete
 
constexpr GLContextScoped (GLContext &&other)
 Move constructor.
 
 ~GLContextScoped ()
 Destructor.
 
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...
 
- Public Member Functions inherited from SDL::GLContext
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.
 
GLContextoperator= (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...
 

Member Function Documentation

◆ GLContext() [1/2]

constexpr SDL::GLContext::GLContext ( const GLContextRaw  resource)
inlineconstexpr
Parameters
resourcea GLContextRaw to be wrapped.

◆ GLContext() [2/2]

SDL::GLContext::GLContext ( WindowParam  window)
inline

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
windowthe 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 struct was generated from the following file: