fix(api): fix incorrect ImDrawData#getCmdListCmdBufferTextureId return type (#272)
Method must return long to be consistent with API in general.
This commit is contained in:
1 parent
c0ea002d07
commit
36d9e3a13c
3 files changed
+4
-4
No files matched your search
@@ -63,7 +63,7 @@ public final class ImDrawData extends ImGuiStruct {
|
||||
* User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions.
|
||||
* Ignore if never using images or multiple fonts atlas.
|
||||
*/
|
||||
public native int getCmdListCmdBufferTextureId(int cmdListIdx, int cmdBufferIdx); /*
|
||||
public native long getCmdListCmdBufferTextureId(int cmdListIdx, int cmdBufferIdx); /*
|
||||
return (uintptr_t)THIS->CmdLists[cmdListIdx]->CmdBuffer[cmdBufferIdx].GetTexID();
|
||||
*/
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public final class ImDrawData extends ImGuiStruct {
|
||||
* User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions.
|
||||
* Ignore if never using images or multiple fonts atlas.
|
||||
*/
|
||||
public native int getCmdListCmdBufferTextureId(int cmdListIdx, int cmdBufferIdx); /*
|
||||
public native long getCmdListCmdBufferTextureId(int cmdListIdx, int cmdBufferIdx); /*
|
||||
return (uintptr_t)THIS->CmdLists[cmdListIdx]->CmdBuffer[cmdBufferIdx].GetTexID();
|
||||
*/
|
||||
|
||||
|
||||
@@ -474,14 +474,14 @@ public class ImGuiImplGl3 {
|
||||
glScissor((int) clipMinX, (int) (fbHeight - clipMaxY), (int) (clipMaxX - clipMinX), (int) (clipMaxY - clipMinY));
|
||||
|
||||
// Bind texture, Draw
|
||||
final int textureId = drawData.getCmdListCmdBufferTextureId(n, cmdIdx);
|
||||
final long textureId = drawData.getCmdListCmdBufferTextureId(n, cmdIdx);
|
||||
final int elemCount = drawData.getCmdListCmdBufferElemCount(n, cmdIdx);
|
||||
final int idxOffset = drawData.getCmdListCmdBufferIdxOffset(n, cmdIdx);
|
||||
final int vtxOffset = drawData.getCmdListCmdBufferVtxOffset(n, cmdIdx);
|
||||
final long indices = idxOffset * (long) ImDrawData.sizeOfImDrawIdx();
|
||||
final int type = ImDrawData.sizeOfImDrawIdx() == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT;
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, textureId);
|
||||
glBindTexture(GL_TEXTURE_2D, (int) textureId);
|
||||
|
||||
if (data.glVersion >= 320) {
|
||||
glDrawElementsBaseVertex(GL_TRIANGLES, elemCount, type, indices, vtxOffset);
|
||||
|
||||
Reference in new issue
Block a user