Skip to content

Commit

Permalink
Close #36
Browse files Browse the repository at this point in the history
  • Loading branch information
lwjglgamedev committed Jul 23, 2022
1 parent a3d3022 commit b7b3d44
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions bookcontents/chapter-15/chapter-15.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,11 @@ public class GuiRenderActivity {
rect.extent(it -> it.width((int) (imVec4.z - imVec4.x)).height((int) (imVec4.w - imVec4.y)));
vkCmdSetScissor(cmdHandle, 0, rect);
int numElements = imDrawData.getCmdListCmdBufferElemCount(i, j);
vkCmdDrawIndexed(cmdHandle, numElements, 1, offsetIdx, offsetVtx, 0);
offsetIdx += numElements;
vkCmdDrawIndexed(cmdHandle, numElements, 1,
offsetIdx + imDrawData.getCmdListCmdBufferIdxOffset(i, j),
offsetVtx + imDrawData.getCmdListCmdBufferVtxOffset(i, j), 0);
}
offsetIdx += imDrawData.getCmdListIdxBufferSize(i);
offsetVtx += imDrawData.getCmdListVtxBufferSize(i);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,11 @@ public void recordCommandBuffer(Scene scene, CommandBuffer commandBuffer) {
rect.extent(it -> it.width((int) (imVec4.z - imVec4.x)).height((int) (imVec4.w - imVec4.y)));
vkCmdSetScissor(cmdHandle, 0, rect);
int numElements = imDrawData.getCmdListCmdBufferElemCount(i, j);
vkCmdDrawIndexed(cmdHandle, numElements, 1, offsetIdx, offsetVtx, 0);
offsetIdx += numElements;
vkCmdDrawIndexed(cmdHandle, numElements, 1,
offsetIdx + imDrawData.getCmdListCmdBufferIdxOffset(i, j),
offsetVtx + imDrawData.getCmdListCmdBufferVtxOffset(i, j), 0);
}
offsetIdx += imDrawData.getCmdListIdxBufferSize(i);
offsetVtx += imDrawData.getCmdListVtxBufferSize(i);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,11 @@ public void recordCommandBuffer(Scene scene, CommandBuffer commandBuffer) {
rect.extent(it -> it.width((int) (imVec4.z - imVec4.x)).height((int) (imVec4.w - imVec4.y)));
vkCmdSetScissor(cmdHandle, 0, rect);
int numElements = imDrawData.getCmdListCmdBufferElemCount(i, j);
vkCmdDrawIndexed(cmdHandle, numElements, 1, offsetIdx, offsetVtx, 0);
offsetIdx += numElements;
vkCmdDrawIndexed(cmdHandle, numElements, 1,
offsetIdx + imDrawData.getCmdListCmdBufferIdxOffset(i, j),
offsetVtx + imDrawData.getCmdListCmdBufferVtxOffset(i, j), 0);
}
offsetIdx += imDrawData.getCmdListIdxBufferSize(i);
offsetVtx += imDrawData.getCmdListVtxBufferSize(i);
}
}
Expand Down

0 comments on commit b7b3d44

Please sign in to comment.