Skip to content

Commit 36d9e3a

Browse files
authored
fix(api): fix incorrect ImDrawData#getCmdListCmdBufferTextureId return type (#272)
Method must return long to be consistent with API in general.
1 parent c0ea002 commit 36d9e3a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

imgui-binding/src/generated/java/imgui/ImDrawData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public ImVec4 getCmdListCmdBufferClipRect(final int cmdListIdx, final int cmdBuf
6363
* User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions.
6464
* Ignore if never using images or multiple fonts atlas.
6565
*/
66-
public native int getCmdListCmdBufferTextureId(int cmdListIdx, int cmdBufferIdx); /*
66+
public native long getCmdListCmdBufferTextureId(int cmdListIdx, int cmdBufferIdx); /*
6767
return (uintptr_t)THIS->CmdLists[cmdListIdx]->CmdBuffer[cmdBufferIdx].GetTexID();
6868
*/
6969

imgui-binding/src/main/java/imgui/ImDrawData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public ImVec4 getCmdListCmdBufferClipRect(final int cmdListIdx, final int cmdBuf
6767
* User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions.
6868
* Ignore if never using images or multiple fonts atlas.
6969
*/
70-
public native int getCmdListCmdBufferTextureId(int cmdListIdx, int cmdBufferIdx); /*
70+
public native long getCmdListCmdBufferTextureId(int cmdListIdx, int cmdBufferIdx); /*
7171
return (uintptr_t)THIS->CmdLists[cmdListIdx]->CmdBuffer[cmdBufferIdx].GetTexID();
7272
*/
7373

imgui-lwjgl3/src/main/java/imgui/gl3/ImGuiImplGl3.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,14 +474,14 @@ public void renderDrawData(final ImDrawData drawData) {
474474
glScissor((int) clipMinX, (int) (fbHeight - clipMaxY), (int) (clipMaxX - clipMinX), (int) (clipMaxY - clipMinY));
475475

476476
// Bind texture, Draw
477-
final int textureId = drawData.getCmdListCmdBufferTextureId(n, cmdIdx);
477+
final long textureId = drawData.getCmdListCmdBufferTextureId(n, cmdIdx);
478478
final int elemCount = drawData.getCmdListCmdBufferElemCount(n, cmdIdx);
479479
final int idxOffset = drawData.getCmdListCmdBufferIdxOffset(n, cmdIdx);
480480
final int vtxOffset = drawData.getCmdListCmdBufferVtxOffset(n, cmdIdx);
481481
final long indices = idxOffset * (long) ImDrawData.sizeOfImDrawIdx();
482482
final int type = ImDrawData.sizeOfImDrawIdx() == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT;
483483

484-
glBindTexture(GL_TEXTURE_2D, textureId);
484+
glBindTexture(GL_TEXTURE_2D, (int) textureId);
485485

486486
if (data.glVersion >= 320) {
487487
glDrawElementsBaseVertex(GL_TRIANGLES, elemCount, type, indices, vtxOffset);

0 commit comments

Comments
 (0)