16 const int glad_result = gladLoadGLLoader(loader);
19 LOG_ERROR(
"Failed to init glad, error: {0}", glad_result);
24 const std::string gl_vendor =
reinterpret_cast<const char*
>(glGetString(GL_VENDOR));
25 const std::string gl_renderer =
reinterpret_cast<const char*
>(glGetString(GL_RENDERER));
26 const std::string gl_version =
reinterpret_cast<const char*
>(glGetString(GL_VERSION));
27 const std::string gl_shading_language_version =
reinterpret_cast<const char*
>(glGetString(GL_SHADING_LANGUAGE_VERSION));
30 LOG_INFO(
"Renderer: {0}", gl_renderer);
31 LOG_INFO(
"Version OpenGL: {0}", gl_version);
32 LOG_INFO(
"Version GLSL: {0}", gl_shading_language_version);
35 int attribute_count = 0;
36 glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &attribute_count);
37 LOG_INFO(
"Max shader attribute count: {0}", attribute_count);
40 glEnable(GL_DEPTH_TEST);
41 glEnable(GL_STENCIL_TEST);
42 glEnable(GL_SCISSOR_TEST);
49 glDisable(GL_CULL_FACE);
52 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
72 glDisable(GL_DEPTH_TEST);
80 glClearColor(color.r, color.g, color.b, 1.0f);
82 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
void *(*)(const char *name) LoaderFunction
static mat4f create_ortho(float l, float r, float b, float t, float n, float f)
void clear_screen(const Rgb &color) const
mat4f get_ortho_projection(float width, float height) const
Init(LoaderFunction loader, BlendHack blend_hack=BlendHack::no_hack)