added vtx offset handling to the renderer

internals
Sebastian Neusser 4 years ago
parent 653ef38a0e
commit 12ff7a925a
  1. 3
      src/ImGui.NET.SampleProgram/ImGuiController.cs

@ -63,6 +63,7 @@ namespace ImGuiNET
ImGui.SetCurrentContext(context); ImGui.SetCurrentContext(context);
var fonts = ImGui.GetIO().Fonts; var fonts = ImGui.GetIO().Fonts;
ImGui.GetIO().Fonts.AddFontDefault(); ImGui.GetIO().Fonts.AddFontDefault();
ImGui.GetIO().BackendFlags |= ImGuiBackendFlags.RendererHasVtxOffset;
CreateDeviceResources(gd, outputDescription); CreateDeviceResources(gd, outputDescription);
SetKeyMappings(); SetKeyMappings();
@ -520,7 +521,7 @@ namespace ImGuiNET
(uint)(pcmd.ClipRect.Z - pcmd.ClipRect.X), (uint)(pcmd.ClipRect.Z - pcmd.ClipRect.X),
(uint)(pcmd.ClipRect.W - pcmd.ClipRect.Y)); (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; idx_offset += (int)pcmd.ElemCount;

Loading…
Cancel
Save