Skip to content

Commit b813d49

Browse files
committed
Minor tweaks
1 parent 2b8828d commit b813d49

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

imgui-binding/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ bintray {
4646
userOrg = user
4747
desc = 'A handcrafted 1-1 Java binding for the Dear-ImGui'
4848
licenses = ['Apache-2.0']
49-
vcsUrl = 'https://github.com/SpaiR/imgui-java'
49+
websiteUrl = 'https://github.com/SpaiR/imgui-java'
50+
issueTrackerUrl = 'https://github.com/SpaiR/imgui-java/issues'
51+
vcsUrl = 'https://github.com/SpaiR/imgui-java.git'
5052
labels = ['dear-imgui', 'java', 'jni']
5153
githubRepo = 'SpaiR/imgui-java'
5254
publicDownloadNumbers = true

imgui-lwjgl3/build.gradle

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,13 @@ task sourcesJar(type: Jar, dependsOn: classes) {
3232
from sourceSets.main.allSource
3333
}
3434

35-
task javadocJar(type: Jar, dependsOn: javadoc) {
36-
archiveClassifier.set('javadoc')
37-
from javadoc.destinationDir
38-
}
39-
4035
publishing {
4136
publications {
4237
MyPublication(MavenPublication) {
4338
from components.java
4439
groupId 'io.imgui.java'
4540
artifactId 'lwjgl3'
4641
artifact sourcesJar
47-
artifact javadocJar
4842
version property('version')
4943
}
5044
}
@@ -61,7 +55,9 @@ bintray {
6155
userOrg = user
6256
desc = 'Backend implementation for imgui-java based on LWJGL3'
6357
licenses = ['Apache-2.0']
64-
vcsUrl = 'https://github.com/SpaiR/imgui-java'
58+
websiteUrl = 'https://github.com/SpaiR/imgui-java'
59+
issueTrackerUrl = 'https://github.com/SpaiR/imgui-java/issues'
60+
vcsUrl = 'https://github.com/SpaiR/imgui-java.git'
6561
labels = ['dear-imgui', 'java', 'lwjgl3']
6662
githubRepo = 'SpaiR/imgui-java'
6763
publicDownloadNumbers = true

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

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
@SuppressWarnings("MagicNumber")
2828
public final class ImGuiGlfwExample {
29-
private static final int DEFAULT_WIDTH = 1024;
29+
private static final int DEFAULT_WIDTH = 1280;
3030
private static final int DEFAULT_HEIGHT = 768;
3131

3232
private long window; // current GLFW window pointer
@@ -80,7 +80,6 @@ private void initGlfw() {
8080
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE); // the window will stay hidden after creation
8181
glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE); // the window will be resizable
8282
glfwWindowHint(GLFW_MAXIMIZED, GLFW_TRUE); // the window will be maximized
83-
glfwWindowHint(GLFW_DECORATED, GLFW_TRUE); // the window will be decorated
8483

8584
// Create the window
8685
window = glfwCreateWindow(DEFAULT_WIDTH, DEFAULT_HEIGHT, "ImGui+GLFW+LWJGL Example", NULL, NULL);
@@ -249,22 +248,18 @@ private void loop() {
249248
glfwSetCursor(window, mouseCursors[imguiCursor]);
250249
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
251250

252-
// Render itself starts here
253-
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // clear the framebuffer
251+
// Clear the framebuffer
252+
glClear(GL_COLOR_BUFFER_BIT);
254253

255254
// IMPORTANT!!
256255
// Any ImGui code SHOULD go between NewFrame()/Render() methods
257256
ImGui.newFrame();
258-
showUi();
259-
ImGui.end();
260-
261-
if (showDemoWindow.get()) {
262-
ImGui.showDemoWindow(showDemoWindow);
263-
}
264-
257+
showUi(); // ImGui calls goes here
265258
ImGui.render();
266259

267-
imGuiGl3.render(ImGui.getDrawData()); // render DrawData from ImGui into our OpenGL context
260+
// After ImGui#render call we provide draw data into LWJGL3 render.
261+
// At that moment ImGui will be rendered to the current OpenGL context.
262+
imGuiGl3.render(ImGui.getDrawData());
268263

269264
glfwSwapBuffers(window); // swap the color buffers
270265

@@ -277,7 +272,7 @@ private void showUi() {
277272
ImGui.setNextWindowSize(600, 300, ImGuiCond.Once);
278273
ImGui.setNextWindowPos(10, 10, ImGuiCond.Once);
279274

280-
ImGui.begin("Custom window");
275+
ImGui.begin("Custom window"); // Start Custom window
281276
ImGui.text("Hello from Java!");
282277

283278
ImGui.button("Drag me");
@@ -324,6 +319,12 @@ private void showUi() {
324319
if (ImGui.button("Copy")) {
325320
ImGui.setClipboardText(imguiDemoLink);
326321
}
322+
323+
ImGui.end(); // End Custom window
324+
325+
if (showDemoWindow.get()) {
326+
ImGui.showDemoWindow(showDemoWindow);
327+
}
327328
}
328329

329330
// If you want to clean a room after yourself - do it by yourself

0 commit comments

Comments
 (0)