summaryrefslogtreecommitdiffhomepage
path: root/src/rlgl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rlgl.c')
-rw-r--r--src/rlgl.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/rlgl.c b/src/rlgl.c
index 373dada9..c336ac4c 100644
--- a/src/rlgl.c
+++ b/src/rlgl.c
@@ -418,7 +418,6 @@ void rlPushMatrix(void)
}
stack[stackCounter] = *currentMatrix;
- rlLoadIdentity();
stackCounter++;
if (currentMatrixMode == RL_MODELVIEW) useTempBuffer = true;
@@ -814,6 +813,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;
@@ -2207,7 +2212,6 @@ void *rlReadTexturePixels(Texture2D texture)
// 2 - Create an fbo, activate it, render quad with texture, glReadPixels()
#define GET_TEXTURE_FBO_OPTION_1 // It works
-
#if defined(GET_TEXTURE_FBO_OPTION_1)
glBindFramebuffer(GL_FRAMEBUFFER, fbo.id);
glBindTexture(GL_TEXTURE_2D, 0);
@@ -2941,7 +2945,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 +3047,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();