Skip to content

Commit

Permalink
fixed the issue where popup windows stopped working
Browse files Browse the repository at this point in the history
  • Loading branch information
zaafar committed Jan 22, 2022
1 parent 3b1ad94 commit 7bd87b8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ClickableTransparentOverlay/ImGuiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ private void RenderImDrawData(ImDrawDataPtr draw_data, GraphicsDevice gd, Comman
for (int i = 0; i < draw_data.CmdListsCount; i++)
{
ImDrawListPtr cmd_list = draw_data.CmdListsRange[i];

cl.UpdateBuffer(
_vertexBuffer,
vertexOffsetInVertices * (uint)Unsafe.SizeOf<ImDrawVert>(),
Expand Down Expand Up @@ -506,6 +505,11 @@ private void RenderImDrawData(ImDrawDataPtr draw_data, GraphicsDevice gd, Comman
for (int cmd_i = 0; cmd_i < cmd_list.CmdBuffer.Size; cmd_i++)
{
ImDrawCmdPtr pcmd = cmd_list.CmdBuffer[cmd_i];
if (pcmd.ElemCount == 0)
{
continue;
}

if (pcmd.UserCallback != IntPtr.Zero)
{
throw new NotImplementedException();
Expand All @@ -531,12 +535,12 @@ private void RenderImDrawData(ImDrawDataPtr draw_data, GraphicsDevice gd, Comman
(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, pcmd.IdxOffset + (uint)idx_offset, (int)pcmd.VtxOffset + vtx_offset, 0);
}

idx_offset += (int)pcmd.ElemCount;
}

vtx_offset += cmd_list.VtxBuffer.Size;
idx_offset += cmd_list.IdxBuffer.Size;
}
}

Expand Down

0 comments on commit 7bd87b8

Please sign in to comment.