NativeStructs

imgui.NativeStructs (Class)

Portable creation of the few ImGui helper structs that user code owns (the generator binds their fields and member functions, but cannot emit constructors: C++ ctor semantics are replicated here per target).

Also provides raw native memory helpers for the rare APIs taking a buffer + size (drag and drop payloads, polyline points...).

Static Members

createListClipper(): ImGuiListClipper

Allocate an ImGuiListClipper (C++ ctor semantics in imgui 1.92: plain zeroing). Destroy it with destroyListClipper when done, or keep one per call site for its lifetime (clippers are reusable).

Returns
ImGuiListClipper

destroyListClipper(clipper: ImGuiListClipper): Void
Name Type
clipper ImGuiListClipper

createSelectionBasicStorage(adapter: Int): ImGuiSelectionBasicStorage

Create an ImGuiSelectionBasicStorage. adapter is the index-to-storage-id function pointer (use imgui.ImGuiCallbacks.selectionAdapter to install a Haxe handler); the C++ constructor installs an identity adapter, but the bindings replicate the ctor per target so the adapter is always set here.

Name Type
adapter Int
Returns
ImGuiSelectionBasicStorage

destroySelectionBasicStorage(storage: ImGuiSelectionBasicStorage): Void
Name Type
storage ImGuiSelectionBasicStorage

createFontConfig(): ImFontConfig

Allocate an ImFontConfig (C++ ctor semantics replicated per target: fontDataOwnedByAtlas=true, glyphMaxAdvanceX=FLT_MAX, rasterizer multiply/density=1). Destroy it with destroyFontConfig when done (the atlas copies the config during AddFont* calls).

Returns
ImFontConfig

destroyFontConfig(cfg: ImFontConfig): Void
Name Type
cfg ImFontConfig

allocBytesFromHaxe(bytes: haxe.io.Bytes): Int

Allocate native bytes and copy a haxe.io.Bytes into them (fast per target: memcpy / HEAPU8.set / Marshal.Copy). Suited to font files and other large blobs. The returned buffer is never freed automatically.

Name Type
bytes haxe.io.Bytes
Returns
Int

allocBytes(size: Int): Int

Allocate raw native bytes (for payloads, point buffers...). The address type follows the target's convention (cpp pointer, js Int, cs Float); use the Bytes* helpers below to read/write portably.

Name Type
size Int
Returns
Int

setU8(buffer: Int, offset: Int, value: Int): Void
Name Type
buffer Int
offset Int
value Int

getU8(buffer: Int, offset: Int): Int
Name Type
buffer Int
offset Int
Returns
Int

setI32(buffer: Int, offset: Int, value: Int): Void
Name Type
buffer Int
offset Int
value Int

getI32(buffer: Int, offset: Int): Int
Name Type
buffer Int
offset Int
Returns
Int

setI16(buffer: Int, offset: Int, value: Int): Void
Name Type
buffer Int
offset Int
value Int

getI16(buffer: Int, offset: Int): Int
Name Type
buffer Int
offset Int
Returns
Int

setI64(buffer: Int, offset: Int, value: Float): Void

64-bit integers cross as Haxe Float (53-bit precision, fine for UI demo values).

Name Type
buffer Int
offset Int
value Float

getI64(buffer: Int, offset: Int): Float
Name Type
buffer Int
offset Int
Returns
Float

setF64(buffer: Int, offset: Int, value: Float): Void
Name Type
buffer Int
offset Int
value Float

getF64(buffer: Int, offset: Int): Float
Name Type
buffer Int
offset Int
Returns
Float

setF32(buffer: Int, offset: Int, value: Float): Void
Name Type
buffer Int
offset Int
value Float

getF32(buffer: Int, offset: Int): Float
Name Type
buffer Int
offset Int
Returns
Float