From 4b30bd70d02c57f353524165ebda41e96cc46373 Mon Sep 17 00:00:00 2001 From: Reuben Dunnington Date: Mon, 18 Sep 2023 21:00:13 -0700 Subject: [PATCH] fix gl error spam when window is resized to 0 width/height --- src/runtime.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime.c b/src/runtime.c index 2b540c0..3aa59f6 100644 --- a/src/runtime.c +++ b/src/runtime.c @@ -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, -- 2.25.1