summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRay <[email protected]>2019-03-29 12:27:50 +0100
committerRay <[email protected]>2019-03-29 12:27:50 +0100
commit876c64b1e530b4b9826eef8fcfc5c3bc567c6be8 (patch)
treecf14400910b94918fc35b2669e500cd7b5a3ab51 /src
parent69656cb090a53705c515975c127405af87d4f15d (diff)
downloadraylib-876c64b1e530b4b9826eef8fcfc5c3bc567c6be8.tar.gz
raylib-876c64b1e530b4b9826eef8fcfc5c3bc567c6be8.zip
WARNING: This could break something
If we have no data to update/draw, we avoid update/draw. On `DrawBuffersDefault()` if no vertes data is available nothing is drawn but some globals: vertexData, projection, modelview, draws... are reseted. There shouldn't be any problem if we don't touch those globals in case no vertex have been processed but, just in case, I warn about it.
Diffstat (limited to 'src')
-rw-r--r--src/rlgl.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index d4faec18..49ab1de5 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -1786,8 +1786,12 @@ void rlglClose(void)
void rlglDraw(void)
{
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
- UpdateBuffersDefault();
- DrawBuffersDefault(); // NOTE: Stereo rendering is checked inside
+ // Only process data if we have data to process
+ if (vertexData[currentBuffer].vCounter > 0)
+ {
+ UpdateBuffersDefault();
+ DrawBuffersDefault(); // NOTE: Stereo rendering is checked inside
+ }
#endif
}