summaryrefslogtreecommitdiffhomepage
path: root/src/rlgl.h
diff options
context:
space:
mode:
authorjtainer <[email protected]>2022-11-15 06:30:32 -0500
committerGitHub <[email protected]>2022-11-15 12:30:32 +0100
commit2761aa40dd7213e9ace68eb5f0aa82d8e505edcc (patch)
tree07cc5fa26d614047789e810be4d945378898ee6b /src/rlgl.h
parentc8fd93d35628545a22189f07c39e4cb821ddc1c2 (diff)
downloadraylib-2761aa40dd7213e9ace68eb5f0aa82d8e505edcc.tar.gz
raylib-2761aa40dd7213e9ace68eb5f0aa82d8e505edcc.zip
Added function rlCullFace (#2797)
rlCullFace sets the face culling mode to RL_FRONT or RL_BACK which correspond to GL_FRONT and GL_BACK respectively.
Diffstat (limited to 'src/rlgl.h')
-rw-r--r--src/rlgl.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index 79c661cd..eb6f9afe 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -498,6 +498,12 @@ typedef enum {
RL_ATTACHMENT_RENDERBUFFER = 200, // Framebuffer texture attachment type: renderbuffer
} rlFramebufferAttachTextureType;
+// Face culling mode
+typedef enum {
+ RL_FRONT = 0,
+ RL_BACK
+} rlCullMode;
+
//------------------------------------------------------------------------------------
// Functions Declaration - Matrix operations
//------------------------------------------------------------------------------------
@@ -578,6 +584,7 @@ RLAPI void rlEnableDepthMask(void); // Enable depth write
RLAPI void rlDisableDepthMask(void); // Disable depth write
RLAPI void rlEnableBackfaceCulling(void); // Enable backface culling
RLAPI void rlDisableBackfaceCulling(void); // Disable backface culling
+RLAPI void rlCullFace(rlCullMode mode); // Set face culling mode
RLAPI void rlEnableScissorTest(void); // Enable scissor test
RLAPI void rlDisableScissorTest(void); // Disable scissor test
RLAPI void rlScissor(int x, int y, int width, int height); // Scissor test
@@ -1671,6 +1678,18 @@ void rlEnableBackfaceCulling(void) { glEnable(GL_CULL_FACE); }
// Disable backface culling
void rlDisableBackfaceCulling(void) { glDisable(GL_CULL_FACE); }
+// Set face culling mode
+void rlCullFace(rlCullMode mode) {
+ switch (mode) {
+ case RL_BACK:
+ glCullFace(GL_BACK);
+ break;
+ case RL_FRONT:
+ glCullFace(GL_FRONT);
+ break;
+ }
+}
+
// Enable scissor test
void rlEnableScissorTest(void) { glEnable(GL_SCISSOR_TEST); }