ImGui-Pascal icon indicating copy to clipboard operation
ImGui-Pascal copied to clipboard

Add optional 32-bit ImDrawIdx support (large meshes) in Pascal binding

Open flydev-fr opened this issue 3 months ago • 1 comments

Hi, I forgot to ask in my previous PR if you could provide a version with 32-bit indices support for drawing large meshes, aligned with ImGui’s documented compile-time switch:

https://github.com/ocornut/imgui/blob/e728b966003104c7fc21a007237bca10abf39b19/imgui.h#L3080-L3085

// ImDrawIdx: vertex index. [Compile-time configurable type]
// - To use 16-bit indices + allow large meshes: backend sets 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset'
//   and handles ImDrawCmd::VtxOffset (recommended).
// - To use 32-bit indices: override with '#define ImDrawIdx unsigned int' in your imconfig.h file.
#ifndef ImDrawIdx
typedef unsigned short ImDrawIdx; // Default: 16-bit
#endif

Default (current): ImDrawIdx = Word (16-bit) In the version I am asking for, I am expecting: ImDrawIdx = Cardinal (32-bit)

https://github.com/Coldzer0/ImGui-Pascal/blob/9ae8fb661a37a31c8d2c828de9e497f288dbda23/src/PasImGui.Apis.inc#L2230

with default 16-bit we are limited to 65,536 vertices buffer - I tried with the following without good result io.BackendFlags := io.BackendFlags or ImGuiBackendFlags_RendererHasVtxOffset;

flydev-fr avatar Aug 23 '25 10:08 flydev-fr

with default 16-bit we are limited to 65,536 vertices buffer - I tried with the following without good result

io.BackendFlags := io.BackendFlags or ImGuiBackendFlags_RendererHasVtxOffset;

This won't work on current version because the default is compiled with ImDrawIdx set to 16-bits I'll compile a new version with the default ImDrawIdx to be 32-bits ( It makes more sense to make it 32-bits )

Coldzer0 avatar Aug 23 '25 13:08 Coldzer0