imGui: Fix mishandling of the ImDrawCmd::IdxOffset field

This commit is contained in:
Joel16 2022-01-11 00:18:03 -05:00
parent 4578cb0b18
commit 147e65e488

View File

@ -223,9 +223,8 @@ void ImGui_ImplVitaGL_RenderDrawData(ImDrawData *draw_data) {
// Bind texture, Draw
glBindTexture(GL_TEXTURE_2D, reinterpret_cast<GLuint>(pcmd->GetTexID()));
glDrawElements(GL_TRIANGLES, static_cast<GLsizei>(pcmd->ElemCount), sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer);
glDrawElements(GL_TRIANGLES, static_cast<GLsizei>(pcmd->ElemCount), sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer + pcmd->IdxOffset);
}
idx_buffer += pcmd->ElemCount;
}
}