Skip to content

Commit

Permalink
Corrected issue with depth initialization #1179
Browse files Browse the repository at this point in the history
  • Loading branch information
raysan5 committed Apr 6, 2020
1 parent 0a25b9d commit 62b7064
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rlgl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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
Expand Down

0 comments on commit 62b7064

Please sign in to comment.