aboutsummaryrefslogtreecommitdiff
path: root/src/rlgl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rlgl.c')
-rw-r--r--src/rlgl.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rlgl.c b/src/rlgl.c
index d9761732..f9722eda 100644
--- a/src/rlgl.c
+++ b/src/rlgl.c
@@ -780,6 +780,18 @@ void rlDisableTexture(void)
#endif
}
+// Enable depth test
+void rlEnableDepthTest(void)
+{
+ glEnable(GL_DEPTH_TEST);
+}
+
+// Disable depth test
+void rlDisableDepthTest(void)
+{
+ glDisable(GL_DEPTH_TEST);
+}
+
// Unload texture from GPU memory
void rlDeleteTextures(unsigned int id)
{
@@ -1579,7 +1591,7 @@ void rlglInitGraphics(int offsetX, int offsetY, int width, int height)
//glClearDepth(1.0f); // Clear depth buffer (default)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear used buffers, depth buffer is used for 3D
- glEnable(GL_DEPTH_TEST); // Enables depth testing (required for 3D)
+ glDisable(GL_DEPTH_TEST); // Disable depth testing for 2D (only used for 3D)
glDepthFunc(GL_LEQUAL); // Type of depth testing to apply
glEnable(GL_BLEND); // Enable color blending (required to work with transparencies)