Skip to content

Commit 12ff7a9

Browse files
committed
added vtx offset handling to the renderer
1 parent 653ef38 commit 12ff7a9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/ImGui.NET.SampleProgram/ImGuiController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public ImGuiController(GraphicsDevice gd, OutputDescription outputDescription, i
6363
ImGui.SetCurrentContext(context);
6464
var fonts = ImGui.GetIO().Fonts;
6565
ImGui.GetIO().Fonts.AddFontDefault();
66+
ImGui.GetIO().BackendFlags |= ImGuiBackendFlags.RendererHasVtxOffset;
6667

6768
CreateDeviceResources(gd, outputDescription);
6869
SetKeyMappings();
@@ -520,7 +521,7 @@ private void RenderImDrawData(ImDrawDataPtr draw_data, GraphicsDevice gd, Comman
520521
(uint)(pcmd.ClipRect.Z - pcmd.ClipRect.X),
521522
(uint)(pcmd.ClipRect.W - pcmd.ClipRect.Y));
522523

523-
cl.DrawIndexed(pcmd.ElemCount, 1, (uint)idx_offset, vtx_offset, 0);
524+
cl.DrawIndexed(pcmd.ElemCount, 1, (uint)idx_offset, (int) (vtx_offset + pcmd.VtxOffset), 0);
524525
}
525526

526527
idx_offset += (int)pcmd.ElemCount;

0 commit comments

Comments
 (0)