mirror of https://github.com/raysan5/raylib
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.
This commit is contained in:
parent
c8fd93d356
commit
2761aa40dd
19
src/rlgl.h
19
src/rlgl.h
|
@ -498,6 +498,12 @@ typedef enum {
|
||||||
RL_ATTACHMENT_RENDERBUFFER = 200, // Framebuffer texture attachment type: renderbuffer
|
RL_ATTACHMENT_RENDERBUFFER = 200, // Framebuffer texture attachment type: renderbuffer
|
||||||
} rlFramebufferAttachTextureType;
|
} rlFramebufferAttachTextureType;
|
||||||
|
|
||||||
|
// Face culling mode
|
||||||
|
typedef enum {
|
||||||
|
RL_FRONT = 0,
|
||||||
|
RL_BACK
|
||||||
|
} rlCullMode;
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
// Functions Declaration - Matrix operations
|
// Functions Declaration - Matrix operations
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
|
@ -578,6 +584,7 @@ RLAPI void rlEnableDepthMask(void); // Enable depth write
|
||||||
RLAPI void rlDisableDepthMask(void); // Disable depth write
|
RLAPI void rlDisableDepthMask(void); // Disable depth write
|
||||||
RLAPI void rlEnableBackfaceCulling(void); // Enable backface culling
|
RLAPI void rlEnableBackfaceCulling(void); // Enable backface culling
|
||||||
RLAPI void rlDisableBackfaceCulling(void); // Disable 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 rlEnableScissorTest(void); // Enable scissor test
|
||||||
RLAPI void rlDisableScissorTest(void); // Disable scissor test
|
RLAPI void rlDisableScissorTest(void); // Disable scissor test
|
||||||
RLAPI void rlScissor(int x, int y, int width, int height); // 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
|
// Disable backface culling
|
||||||
void rlDisableBackfaceCulling(void) { glDisable(GL_CULL_FACE); }
|
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
|
// Enable scissor test
|
||||||
void rlEnableScissorTest(void) { glEnable(GL_SCISSOR_TEST); }
|
void rlEnableScissorTest(void) { glEnable(GL_SCISSOR_TEST); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue