mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-21 18:58:14 +00:00
RLGL: restore draw batch state after limit check (#2018)
This commit is contained in:
@@ -2548,8 +2548,15 @@ bool rlCheckRenderBatchLimit(int vCount)
|
|||||||
if ((RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter + vCount) >=
|
if ((RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].vCounter + vCount) >=
|
||||||
(RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].elementCount*4))
|
(RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].elementCount*4))
|
||||||
{
|
{
|
||||||
|
int currentMode = RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].mode;
|
||||||
|
int currentTexture = RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].textureId;
|
||||||
|
|
||||||
overflow = true;
|
overflow = true;
|
||||||
rlDrawRenderBatch(RLGL.currentBatch); // NOTE: Stereo rendering is checked inside
|
rlDrawRenderBatch(RLGL.currentBatch); // NOTE: Stereo rendering is checked inside
|
||||||
|
|
||||||
|
// restore state of last batch so we can continue adding vertices
|
||||||
|
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].mode = currentMode;
|
||||||
|
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].textureId = currentTexture;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user