1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:37:45 +00:00

LibAccelGfx: Use wrapping functions with error check for OpenGL calls

This change introduces GL.h with error check wrappers for all the
OpenGL functions we used so far.

For now, the error check is simply:
`VERIFY(glGetError() == GL_NO_ERROR);`
but that is better than continuing execution after encounting an error.
This commit is contained in:
Aliaksandr Kalenik 2023-11-10 18:00:18 +01:00 committed by Andreas Kling
parent da88d766b2
commit 048e179572
8 changed files with 313 additions and 130 deletions

View file

@ -7,7 +7,7 @@
#pragma once
#include <AK/Noncopyable.h>
#include <GL/gl.h>
#include <LibAccelGfx/GL.h>
namespace AccelGfx {
@ -18,18 +18,18 @@ public:
static Program create(char const* vertex_shader_source, char const* fragment_shader_source);
void use();
GLuint get_attribute_location(char const* name);
GLuint get_uniform_location(char const* name);
GL::VertexAttribute get_attribute_location(char const* name);
GL::Uniform get_uniform_location(char const* name);
~Program();
private:
Program(GLuint id)
: m_id(id)
Program(GL::Program program)
: m_program(program)
{
}
GLuint m_id { 0 };
GL::Program m_program;
};
}