summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2020-04-06 19:58:28 +0200
committerraysan5 <[email protected]>2020-04-06 19:58:28 +0200
commit62b7064e903fa04a403282ff2af55856da3e037d (patch)
tree80070891b745e1a3fc57a47a031899fa688e64ef
parent0a25b9d39bc8cae1e72c6d82d45dab2cc8d151b9 (diff)
downloadraylib-62b7064e903fa04a403282ff2af55856da3e037d.tar.gz
raylib-62b7064e903fa04a403282ff2af55856da3e037d.zip
Corrected issue with depth initialization #1179
-rw-r--r--src/rlgl.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index 261e792f..72a6e398 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -1700,7 +1700,8 @@ void rlglInit(int width, int height)
//RLGL.State.draws[i].RLGL.State.modelview = MatrixIdentity();
}
- RLGL.State.drawsCounter = 1;
+ RLGL.State.drawsCounter = 1; // Reset draws counter
+ RLGL.State.currentDepth = -1.0f; // Reset depth value
// Init RLGL.State.stack matrices (emulating OpenGL 1.1)
for (int i = 0; i < MAX_MATRIX_STACK_SIZE; i++) RLGL.State.stack[i] = MatrixIdentity();
@@ -1709,6 +1710,7 @@ void rlglInit(int width, int height)
RLGL.State.projection = MatrixIdentity();
RLGL.State.modelview = MatrixIdentity();
RLGL.State.currentMatrix = &RLGL.State.modelview;
+
#endif // GRAPHICS_API_OPENGL_33 || GRAPHICS_API_OPENGL_ES2
// Initialize OpenGL default states