summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGL/GL
diff options
context:
space:
mode:
authorStephan Unverwerth <s.unverwerth@gmx.de>2021-04-24 12:09:56 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-08 10:13:22 +0200
commite6c060049945ca34b7a46917a6674486deebf56e (patch)
treeb3f6a3081aebd398d2819764df72b7a8176c282f /Userland/Libraries/LibGL/GL
parenteff3c8a954dc5024792aaefe07e077337390bd64 (diff)
downloadserenity-e6c060049945ca34b7a46917a6674486deebf56e.zip
LibGL: Add back face culling functions
Adds all needed functions to support back face culling and implements back face culling in the SoftwareGLContext.
Diffstat (limited to 'Userland/Libraries/LibGL/GL')
-rw-r--r--Userland/Libraries/LibGL/GL/gl.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGL/GL/gl.h b/Userland/Libraries/LibGL/GL/gl.h
index 173c6186ee..3c9fa58bd3 100644
--- a/Userland/Libraries/LibGL/GL/gl.h
+++ b/Userland/Libraries/LibGL/GL/gl.h
@@ -32,11 +32,19 @@ extern "C" {
// Buffer bits
#define GL_COLOR_BUFFER_BIT 0x0200
+// Enable capabilities
+#define GL_CULL_FACE 0x0B44
+
// Utility
#define GL_VENDOR 0x1F00
#define GL_RENDERER 0x1F01
#define GL_VERSION 0x1F02
+// Culled face side
+#define GL_FRONT 0x0404
+#define GL_BACK 0x0405
+#define GL_FRONT_AND_BACK 0x0408
+
// Error codes
#define GL_NO_ERROR 0
#define GL_INVALID_ENUM 0x500
@@ -47,6 +55,10 @@ extern "C" {
#define GL_OUT_OF_MEMORY 0x505
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x506
+// Triangle winding order
+#define GL_CW 0x0900
+#define GL_CCW 0x0901
+
//
// OpenGL typedefs
//
@@ -96,6 +108,10 @@ GLAPI void glVertex2fv(const GLfloat* v);
GLAPI void glVertex3f(GLfloat x, GLfloat y, GLfloat z);
GLAPI void glVertex3fv(const GLfloat* v);
GLAPI void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void glEnable(GLenum cap);
+GLAPI void glDisable(GLenum cap);
+GLAPI void glCullFace(GLenum mode);
+GLAPI void glFrontFace(GLenum mode);
#ifdef __cplusplus
}