Browse Source

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.
pull/786/head
Ray 6 years ago
parent
commit
876c64b1e5
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      src/rlgl.h

+ 6
- 2
src/rlgl.h View File

@ -1786,8 +1786,12 @@ void rlglClose(void)
void rlglDraw(void) void rlglDraw(void)
{ {
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) #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 #endif
} }

Loading…
Cancel
Save