From 258b9feeb6813901c3abae80f3e8001810f076d7 Mon Sep 17 00:00:00 2001 From: SpaiR Date: Sat, 11 Jul 2020 19:05:55 +0300 Subject: [PATCH] Tweak ExampleUi --- imgui-lwjgl3/src/main/java/imgui/glfw/ImGuiImplGlfw.java | 5 ++--- imgui-lwjgl3/src/test/java/ExampleUi.java | 9 ++------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/imgui-lwjgl3/src/main/java/imgui/glfw/ImGuiImplGlfw.java b/imgui-lwjgl3/src/main/java/imgui/glfw/ImGuiImplGlfw.java index 3c7d63f..af98ec2 100644 --- a/imgui-lwjgl3/src/main/java/imgui/glfw/ImGuiImplGlfw.java +++ b/imgui-lwjgl3/src/main/java/imgui/glfw/ImGuiImplGlfw.java @@ -87,14 +87,13 @@ import static org.lwjgl.glfw.GLFW.glfwSetScrollCallback; /** * This class is a straightforward port of the - * imgui_impl_glfw.cpp. + * imgui_impl_glfw.cpp. *

* 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 * modify the rendering routine in the way you'd like. */ public class ImGuiImplGlfw { - - // Id of the current GLFW window + // Pointer of the current GLFW window private long windowPtr; // For application window properties diff --git a/imgui-lwjgl3/src/test/java/ExampleUi.java b/imgui-lwjgl3/src/test/java/ExampleUi.java index 57cbdea..d1e5b1c 100644 --- a/imgui-lwjgl3/src/test/java/ExampleUi.java +++ b/imgui-lwjgl3/src/test/java/ExampleUi.java @@ -2,7 +2,6 @@ import imgui.type.ImBoolean; import imgui.ImColor; import imgui.ImGui; import imgui.type.ImString; -import imgui.ImVec2; import imgui.flag.ImGuiColorEditFlags; import imgui.flag.ImGuiCond; import imgui.flag.ImGuiInputTextFlags; @@ -35,8 +34,6 @@ final class ExampleUi { // Attach image example private int dukeTexture; - final ImVec2 windowSize = new ImVec2(); // Vector to store "Custom Window" size - final ImVec2 windowPos = new ImVec2(); // Vector to store "Custom Window" position void init() throws Exception { dukeTexture = loadTexture(ImageIO.read(new File("src/test/resources/Duke_waving.png"))); @@ -49,10 +46,8 @@ final class ExampleUi { ImGui.begin("Custom window"); // Start Custom window // Draw an image in the bottom-right corner of the window - ImGui.getWindowSize(windowSize); - ImGui.getWindowPos(windowPos); - final float xPoint = windowPos.x + windowSize.x - 100; - final float yPoint = windowPos.y + windowSize.y; + final float xPoint = ImGui.getWindowPosX() + ImGui.getWindowSizeX() - 100; + final float yPoint = ImGui.getWindowPosY() + ImGui.getWindowSizeY(); ImGui.getWindowDrawList().addImage(dukeTexture, xPoint, yPoint - 180, xPoint + 100, yPoint); // Checkbox to show demo window