summaryrefslogtreecommitdiffhomepage
path: root/examples/models
diff options
context:
space:
mode:
authorRay <[email protected]>2021-03-23 23:45:14 +0100
committerRay <[email protected]>2021-03-23 23:45:14 +0100
commit60bfee4a7d94bd28490190d7fa0c3a8a344021a5 (patch)
tree389f34bf1a3a54fc7681c46ef411a8f35801f8bf /examples/models
parentc5b0a1f0056bdd3562c8c5775080a839a4bb2290 (diff)
downloadraylib-60bfee4a7d94bd28490190d7fa0c3a8a344021a5.tar.gz
raylib-60bfee4a7d94bd28490190d7fa0c3a8a344021a5.zip
Added security check for render batch #1670
Diffstat (limited to 'examples/models')
-rw-r--r--examples/models/models_rlgl_solar_system.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/models/models_rlgl_solar_system.c b/examples/models/models_rlgl_solar_system.c
index e6a28cf6..7eda6c76 100644
--- a/examples/models/models_rlgl_solar_system.c
+++ b/examples/models/models_rlgl_solar_system.c
@@ -135,6 +135,10 @@ void DrawSphereBasic(Color color)
{
int rings = 16;
int slices = 16;
+
+ // Make sure there is enough space in the internal render batch
+ // buffer to store all required vertex, batch is reseted if required
+ rlCheckRenderBatchLimit((rings + 2)*slices*6);
rlBegin(RL_TRIANGLES);
rlColor4ub(color.r, color.g, color.b, color.a);