From 12ff7a925a0fc97fdaa14f80716d8b0d8ac4ee12 Mon Sep 17 00:00:00 2001 From: Sebastian Neusser Date: Fri, 26 Mar 2021 23:40:18 +0100 Subject: [PATCH] added vtx offset handling to the renderer --- src/ImGui.NET.SampleProgram/ImGuiController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ImGui.NET.SampleProgram/ImGuiController.cs b/src/ImGui.NET.SampleProgram/ImGuiController.cs index 4cbe615..53c94d3 100644 --- a/src/ImGui.NET.SampleProgram/ImGuiController.cs +++ b/src/ImGui.NET.SampleProgram/ImGuiController.cs @@ -63,6 +63,7 @@ namespace ImGuiNET ImGui.SetCurrentContext(context); var fonts = ImGui.GetIO().Fonts; ImGui.GetIO().Fonts.AddFontDefault(); + ImGui.GetIO().BackendFlags |= ImGuiBackendFlags.RendererHasVtxOffset; CreateDeviceResources(gd, outputDescription); SetKeyMappings(); @@ -520,7 +521,7 @@ namespace ImGuiNET (uint)(pcmd.ClipRect.Z - pcmd.ClipRect.X), (uint)(pcmd.ClipRect.W - pcmd.ClipRect.Y)); - cl.DrawIndexed(pcmd.ElemCount, 1, (uint)idx_offset, vtx_offset, 0); + cl.DrawIndexed(pcmd.ElemCount, 1, (uint)idx_offset, (int) (vtx_offset + pcmd.VtxOffset), 0); } idx_offset += (int)pcmd.ElemCount;