summaryrefslogtreecommitdiffhomepage
path: root/src/rlgl.c
diff options
context:
space:
mode:
authorRay <[email protected]>2017-09-13 22:23:24 +0200
committerRay <[email protected]>2017-09-13 22:23:24 +0200
commit1d91a460088a4c4e33dfa94c6d2bd0bf859e9986 (patch)
tree20006483f73e6a3071e91fe656784b690324d24c /src/rlgl.c
parentf3f6d3fd8ee5145a9ac8d66ebccc1d75e3e73dff (diff)
downloadraylib-1d91a460088a4c4e33dfa94c6d2bd0bf859e9986.tar.gz
raylib-1d91a460088a4c4e33dfa94c6d2bd0bf859e9986.zip
Corrected out-of-bounds array issue
Diffstat (limited to 'src/rlgl.c')
-rw-r--r--src/rlgl.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rlgl.c b/src/rlgl.c
index 373dada9..13f084f3 100644
--- a/src/rlgl.c
+++ b/src/rlgl.c
@@ -814,6 +814,12 @@ void rlEnableTexture(unsigned int id)
if (draws[drawsCounter - 1].textureId != id)
{
if (draws[drawsCounter - 1].vertexCount > 0) drawsCounter++;
+
+ if (drawsCounter >= MAX_DRAWS_BY_TEXTURE)
+ {
+ rlglDraw();
+ drawsCounter = 1;
+ }
draws[drawsCounter - 1].textureId = id;
draws[drawsCounter - 1].vertexCount = 0;
@@ -2941,7 +2947,7 @@ void ToggleVrMode(void)
// Reset viewport and default projection-modelview matrices
rlViewport(0, 0, screenWidth, screenHeight);
- projection = MatrixOrtho(0, screenWidth, screenHeight, 0, 0.0f, 1.0f);
+ projection = MatrixOrtho(0.0, screenWidth, screenHeight, 0.0, 0.0, 1.0);
modelview = MatrixIdentity();
}
else vrStereoRender = true;
@@ -3043,7 +3049,7 @@ void EndVrDrawing(void)
// Reset viewport and default projection-modelview matrices
rlViewport(0, 0, screenWidth, screenHeight);
- projection = MatrixOrtho(0, screenWidth, screenHeight, 0, 0.0f, 1.0f);
+ projection = MatrixOrtho(0.0, screenWidth, screenHeight, 0.0, 0.0, 1.0);
modelview = MatrixIdentity();
rlDisableDepthTest();