diff options
author | Jesse Buhagiar <jooster669@gmail.com> | 2021-04-23 23:48:28 +1000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-08 10:13:22 +0200 |
commit | e537e2690a9a4af1217dd9703aa869da791ed991 (patch) | |
tree | 2f76dbf9342bf7ce90101e7f8ca605eac2e42291 /Userland/Libraries/LibGL/GL/gl.h | |
parent | 4807d3213972725563304c5477c9b90d69e0b53b (diff) | |
download | serenity-e537e2690a9a4af1217dd9703aa869da791ed991.zip |
LibGL: Implement glGetError and underlying function
This implements `glGetError` and correctly sets the state machine's
error macro (similar to LibC `errno`) when an invalid operation is
performed. This is reset on completion of a successful operation.
Diffstat (limited to 'Userland/Libraries/LibGL/GL/gl.h')
-rw-r--r-- | Userland/Libraries/LibGL/GL/gl.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGL/GL/gl.h b/Userland/Libraries/LibGL/GL/gl.h index e494cf092a..132a103265 100644 --- a/Userland/Libraries/LibGL/GL/gl.h +++ b/Userland/Libraries/LibGL/GL/gl.h @@ -37,6 +37,14 @@ extern "C" { #define GL_RENDERER 0x1F01 #define GL_VERSION 0x1F02 +// Error codes +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x500 +#define GL_INVALID_VALUE 0x501 +#define GL_INVALID_OPERATION 0x502 +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x503 +#define GL_OUT_OF_MEMORY 0x504 + // // OpenGL typedefs // @@ -66,6 +74,7 @@ GLAPI void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf al GLAPI void glColor3f(GLfloat r, GLfloat g, GLfloat b); GLAPI void glEnd(); GLAPI void glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearVal, GLdouble farVal); +GLAPI GLenum glGetError(); GLAPI GLubyte* glGetString(GLenum name); GLAPI void glLoadIdentity(); GLAPI void glMatrixMode(GLenum mode); |