Skip to content

Commit

Permalink
[ImGui] Use ImDrawCmd::IdxOffset field
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelLinn committed Sep 22, 2022
1 parent d1689f8 commit fdbd9df
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/xenia/ui/imgui_drawer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -346,23 +346,20 @@ void ImGuiDrawer::RenderDrawLists(ImDrawData* data,
batch.index_count = cmd_list->IdxBuffer.size();
immediate_drawer_->BeginDrawBatch(batch);

int index_offset = 0;
for (int j = 0; j < cmd_list->CmdBuffer.size(); ++j) {
const auto& cmd = cmd_list->CmdBuffer[j];

ImmediateDraw draw;
draw.primitive_type = ImmediatePrimitiveType::kTriangles;
draw.count = cmd.ElemCount;
draw.index_offset = index_offset;
draw.index_offset = cmd.IdxOffset;
draw.texture = reinterpret_cast<ImmediateTexture*>(cmd.TextureId);
draw.scissor = true;
draw.scissor_left = cmd.ClipRect.x;
draw.scissor_top = cmd.ClipRect.y;
draw.scissor_right = cmd.ClipRect.z;
draw.scissor_bottom = cmd.ClipRect.w;
immediate_drawer_->Draw(draw);

index_offset += cmd.ElemCount;
}

immediate_drawer_->EndDrawBatch();
Expand Down

0 comments on commit fdbd9df

Please sign in to comment.