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

An opaque handle to an OpenGL context. More...

Inheritance diagram for SDL::GLContext:
Inheritance graph
[legend]

Public Member Functions

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...
 

Detailed Description

Since
This datatype is available since SDL 3.2.0.
See also
GLContext.GLContext
Category:
Resource

Constructor & Destructor 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 class was generated from the following file: