12#include <brenta/subsystem.hpp>
19#define check_error() gl::_check_error(__FILE__, __LINE__)
36 static const std::string subsystem_name;
41 std::expected<void, subsystem::error> initialize()
override;
42 std::expected<void, subsystem::error> terminate()
override;
43 std::string
name()
override;
52 static gl &instance();
70 static void set_viewport(
int x,
int y,
int width,
int height);
82 static void set_color(
float r,
float g,
float b,
float a);
93 static void draw_arrays(GLenum mode,
int first,
int count);
106 static void draw_elements(GLenum mode,
int count, GLenum type,
107 const void *indices);
116 static void bind_vertex_array(
unsigned int n);
129 static bool initialized;
136 bool enable_blending;
137 bool enable_cull_face;
138 bool enable_multisample;
139 bool enable_depth_test;
static void set_color(float r, float g, float b, float a)
Set Clear Color.
static GLenum _check_error(const char *file, int line)
Check OpenGL error.
static void clear()
Clear.
std::string name() override
Returns the name of the sybsystem.
static void set_poligon_mode(GLboolean enable)
Set Poligon Mode.
static void draw_elements(GLenum mode, int count, GLenum type, const void *indices)
Draw Elements.
bool is_initialized() override
Returns true if the subsystem is initialized.
static void set_viewport(int x, int y, int width, int height)
Set Viewport.
static void draw_arrays(GLenum mode, int first, int count)
Draw Arrays.