Skip to content

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

Description

@flydev-fr

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)

ImDrawIdx = Word;

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;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions