aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2025-12-05 20:54:11 +0100
committerAndre Weissflog <floooh@gmail.com>2025-12-05 20:54:11 +0100
commitb59d3f6d08f99d587409603a9dc672f03a4f46d0 (patch)
treec18b420ebb32ab7fd8b96e938aa736068f55620a
parent57771ef4ddec19089783abd26ccba03e62749855 (diff)
sokol_imgui.h: add log message when internal vertex or index buffer overflows (fixes #1387)
-rw-r--r--CHANGELOG.md4
-rw-r--r--util/sokol_imgui.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5a9ca88a..e4358d86 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,10 @@
PR: https://github.com/floooh/sokol/pull/1394
+- sokol_imgui.h: added an error-level log message when the internal
+ vertex- or index-buffer would overflow
+ (see https://github.com/floooh/sokol/issues/1387)
+
### 04-Dev-2025
- sokol_gfx.h: a minor breaking change for querying runtime statistics: the function
diff --git a/util/sokol_imgui.h b/util/sokol_imgui.h
index 89c47890..670a342e 100644
--- a/util/sokol_imgui.h
+++ b/util/sokol_imgui.h
@@ -458,6 +458,7 @@ extern "C" {
#define _SIMGUI_LOG_ITEMS \
_SIMGUI_LOGITEM_XMACRO(OK, "Ok") \
_SIMGUI_LOGITEM_XMACRO(MALLOC_FAILED, "memory allocation failed") \
+ _SIMGUI_LOGITEM_XMACRO(BUFFER_OVERFLOW, "internal vertex/index buffer overflow (increase simgui_desc_t.max_vertices)")
#define _SIMGUI_LOGITEM_XMACRO(item,msg) SIMGUI_LOGITEM_##item,
typedef enum simgui_log_item_t {
@@ -3201,6 +3202,7 @@ SOKOL_API_IMPL void simgui_render(void) {
if (((all_vtx_size + vtx_size) > _simgui.vertices.size) ||
((all_idx_size + idx_size) > _simgui.indices.size))
{
+ _SIMGUI_ERROR(BUFFER_OVERFLOW);
break;
}