7#include <aegis2d/render/export.hpp>
22class AEGIS2D_RENDER_EXPORT
ContextError :
public std::runtime_error {
24 using std::runtime_error::runtime_error;
49[[nodiscard]] AEGIS2D_RENDER_EXPORT
bool debug_build() noexcept;
121 std::
size_t check_errors();
125 [[nodiscard]]
Version version() const noexcept;
129 [[nodiscard]] static
Version required_version() noexcept;
137 std::unique_ptr<Impl> impl_;
Thrown when the OpenGL context cannot be created or is too old.
Definition context.hpp:22
OpenGL core profile context of a window, with every OpenGL function loaded.
Definition context.hpp:77
~Context()
Destroys the context.
DebugOutput debug_output() const noexcept
How OpenGL errors are reported for this context.
Context(Context &&other) noexcept
Takes over the context of other, which must not be used afterwards.
void swap_buffers()
Shows the frame drawn since the previous call.
Context & operator=(Context &&other) noexcept
Destroys this context and takes over the context of other.
Context & operator=(const Context &)=delete
Context(const Context &)=delete
void clear(Color color)
Fills the whole framebuffer with one color.
void make_current()
Makes the context current on the calling thread.
Context(const platform::Window &window, const ContextConfig &config={})
Creates the context, makes it current and loads the OpenGL functions.
RGBA color used by the renderer.
OpenGL backend of the renderer.
Definition context.hpp:18
bool debug_build() noexcept
Whether the engine was built for debugging.
DebugOutput
How a context reports OpenGL errors.
Definition context.hpp:36
@ Callback
The driver reports each error, warning and hint as it happens (KHR_debug, OpenGL 4....
@ Off
Errors are not reported (release builds by default).
@ Polling
Errors are read with glGetError by each swap_buffers() and check_errors() call (macOS,...
Definition endpoint.hpp:85
RGBA color with components in [0, 1].
Definition color.hpp:10
Settings of a new context.
Definition context.hpp:52
Driver strings of a context.
Definition context.hpp:61
std::string version
Full version string (GL_VERSION).
Definition context.hpp:67
std::string vendor
Company behind the driver (GL_VENDOR).
Definition context.hpp:63
std::string renderer
GPU or software renderer (GL_RENDERER).
Definition context.hpp:65
Version of an OpenGL context.
Definition context.hpp:28
int minor
Minor version, e.g. 5.
Definition context.hpp:32
int major
Major version, e.g. 4.
Definition context.hpp:30
SDL3 desktop window with its events, keyboard, mouse and gamepads, independent of the graphics API.