Skip to content

Commit 41d7f4e

Browse files
committed
Reactor ImGuiImplGl3
- Almost a 1:1 port of original C++ code - Fix for the OpenGL profiles >= 3.2
1 parent 283e780 commit 41d7f4e

File tree

4 files changed

+309
-149
lines changed

4 files changed

+309
-149
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ public final class ImDrawData implements ImDestroyable {
1515
public static final int SIZEOF_IM_DRAW_IDX = 2;
1616
public static final int SIZEOF_IM_DRAW_VERT = (4 + 1) * 4;
1717

18-
private static final int COUNT_FACTOR = 5_000;
18+
private static final int FACTOR = 5_000;
1919

2020
final long ptr;
2121

22-
private ByteBuffer idxBuffer = ByteBuffer.allocateDirect(SIZEOF_IM_DRAW_IDX * COUNT_FACTOR).order(ByteOrder.nativeOrder());
23-
private ByteBuffer vtxBuffer = ByteBuffer.allocateDirect(SIZEOF_IM_DRAW_VERT * COUNT_FACTOR).order(ByteOrder.nativeOrder());
22+
private ByteBuffer idxBuffer = ByteBuffer.allocateDirect(SIZEOF_IM_DRAW_IDX * FACTOR).order(ByteOrder.nativeOrder());
23+
private ByteBuffer vtxBuffer = ByteBuffer.allocateDirect(SIZEOF_IM_DRAW_VERT * FACTOR).order(ByteOrder.nativeOrder());
2424

2525
/**
2626
* This class will create a native structure.
@@ -121,7 +121,7 @@ public void destroy() {
121121
public ByteBuffer getCmdListIdxBufferData(final int cmdListIdx) {
122122
final int idxBufferCapacity = getCmdListIdxBufferSize(cmdListIdx) * SIZEOF_IM_DRAW_IDX;
123123
if (idxBuffer.capacity() < idxBufferCapacity) {
124-
idxBuffer = ByteBuffer.allocateDirect(idxBufferCapacity + COUNT_FACTOR).order(ByteOrder.nativeOrder());
124+
idxBuffer = ByteBuffer.allocateDirect(idxBufferCapacity + FACTOR).order(ByteOrder.nativeOrder());
125125
}
126126

127127
nGetCmdListIdxBufferData(cmdListIdx, idxBuffer, idxBufferCapacity);
@@ -146,7 +146,7 @@ public ByteBuffer getCmdListIdxBufferData(final int cmdListIdx) {
146146
public ByteBuffer getCmdListVtxBufferData(final int cmdListIdx) {
147147
final int vtxBufferCapacity = getCmdListVtxBufferSize(cmdListIdx) * SIZEOF_IM_DRAW_VERT;
148148
if (vtxBuffer.capacity() < vtxBufferCapacity) {
149-
vtxBuffer = ByteBuffer.allocateDirect(vtxBufferCapacity + COUNT_FACTOR).order(ByteOrder.nativeOrder());
149+
vtxBuffer = ByteBuffer.allocateDirect(vtxBufferCapacity + FACTOR).order(ByteOrder.nativeOrder());
150150
}
151151

152152
nGetCmdListVtxBufferData(cmdListIdx, vtxBuffer, vtxBufferCapacity);

0 commit comments

Comments
 (0)