[API] Up OpenGL impl

This commit is contained in:
SpaiR committed 2021-12-26 17:19:04 +02:00
1 parent cbf8ecc47f
commit 384e24a6c5
2 files changed
+71 -23

No files matched your search

@@ -97,7 +97,7 @@ public final class ImDrawData extends ImGuiStruct {
*/
public ByteBuffer getCmdListIdxBufferData(final int cmdListIdx) {
final int idxBufferCapacity = getCmdListIdxBufferSize(cmdListIdx) * SIZEOF_IM_DRAW_IDX;
final int idxBufferCapacity = getCmdListIdxBufferSize(cmdListIdx) * sizeOfImDrawIdx();
if (dataBuffer.capacity() < idxBufferCapacity) {
dataBuffer.clear();
dataBuffer = ByteBuffer.allocateDirect(idxBufferCapacity + RESIZE_FACTOR).order(ByteOrder.nativeOrder());
@@ -123,7 +123,7 @@ public final class ImDrawData extends ImGuiStruct {
*/
public ByteBuffer getCmdListVtxBufferData(final int cmdListIdx) {
final int vtxBufferCapacity = getCmdListVtxBufferSize(cmdListIdx) * SIZEOF_IM_DRAW_VERT;
final int vtxBufferCapacity = getCmdListVtxBufferSize(cmdListIdx) * sizeOfImDrawVert();
if (dataBuffer.capacity() < vtxBufferCapacity) {
dataBuffer.clear();
dataBuffer = ByteBuffer.allocateDirect(vtxBufferCapacity + RESIZE_FACTOR).order(ByteOrder.nativeOrder());
@@ -141,6 +141,14 @@ public final class ImDrawData extends ImGuiStruct {
memcpy(vtxBuffer, IM_DRAW_DATA->CmdLists[cmdListIdx]->VtxBuffer.Data, vtxBufferCapacity);
*/
public static native int sizeOfImDrawVert(); /*
return (int)sizeof(ImDrawVert);
*/
public static native int sizeOfImDrawIdx(); /*
return (int)sizeof(ImDrawIdx);
*/
///////// End of Render Methods
/**