Skip to content

Commit 258b9fe

Browse files
committed
Tweak ExampleUi
1 parent 640f56b commit 258b9fe

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

imgui-lwjgl3/src/main/java/imgui/glfw/ImGuiImplGlfw.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,13 @@
8787

8888
/**
8989
* This class is a straightforward port of the
90-
* <a href="https://raw.githubusercontent.com/ocornut/imgui/v1.76/examples/imgui_impl_glfw.cpp">imgui_impl_glfw.cpp</a>.
90+
* <a href="https://raw.githubusercontent.com/ocornut/imgui/v1.77/examples/imgui_impl_glfw.cpp">imgui_impl_glfw.cpp</a>.
9191
* <p>
9292
* It supports clipboard, gamepad, mouse and keyboard in the same way the original Dear ImGui code does. You can copy-paste this class in your codebase and
9393
* modify the rendering routine in the way you'd like.
9494
*/
9595
public class ImGuiImplGlfw {
96-
97-
// Id of the current GLFW window
96+
// Pointer of the current GLFW window
9897
private long windowPtr;
9998

10099
// For application window properties

imgui-lwjgl3/src/test/java/ExampleUi.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import imgui.ImColor;
33
import imgui.ImGui;
44
import imgui.type.ImString;
5-
import imgui.ImVec2;
65
import imgui.flag.ImGuiColorEditFlags;
76
import imgui.flag.ImGuiCond;
87
import imgui.flag.ImGuiInputTextFlags;
@@ -35,8 +34,6 @@ final class ExampleUi {
3534

3635
// Attach image example
3736
private int dukeTexture;
38-
final ImVec2 windowSize = new ImVec2(); // Vector to store "Custom Window" size
39-
final ImVec2 windowPos = new ImVec2(); // Vector to store "Custom Window" position
4037

4138
void init() throws Exception {
4239
dukeTexture = loadTexture(ImageIO.read(new File("src/test/resources/Duke_waving.png")));
@@ -49,10 +46,8 @@ void render() {
4946
ImGui.begin("Custom window"); // Start Custom window
5047

5148
// Draw an image in the bottom-right corner of the window
52-
ImGui.getWindowSize(windowSize);
53-
ImGui.getWindowPos(windowPos);
54-
final float xPoint = windowPos.x + windowSize.x - 100;
55-
final float yPoint = windowPos.y + windowSize.y;
49+
final float xPoint = ImGui.getWindowPosX() + ImGui.getWindowSizeX() - 100;
50+
final float yPoint = ImGui.getWindowPosY() + ImGui.getWindowSizeY();
5651
ImGui.getWindowDrawList().addImage(dukeTexture, xPoint, yPoint - 180, xPoint + 100, yPoint);
5752

5853
// Checkbox to show demo window

0 commit comments

Comments
 (0)