fix gl error spam when window is resized to 0 width/height

This commit is contained in:
Reuben Dunnington 2023-09-18 21:00:13 -07:00 committed by MartinFouilleul
parent 43273cc170
commit 4b30bd70d0
1 changed files with 4 additions and 0 deletions

View File

@ -279,10 +279,14 @@ void orca_surface_render_commands(oc_surface surface,
char* memBase = app->env.wasmMemory.ptr;
u32 memSize = app->env.wasmMemory.committed;
oc_rect window_content_rect = oc_window_get_content_rect(app->window);
if(((char*)primitives > memBase)
&& ((char*)primitives + primitiveCount * sizeof(oc_primitive) - memBase <= memSize)
&& ((char*)elements > memBase)
&& ((char*)elements + eltCount * sizeof(oc_path_elt) - memBase <= memSize)
&& window_content_rect.w > 0
&& window_content_rect.h > 0
&& oc_window_is_minimized(app->window) == false)
{
oc_surface_render_commands(surface,