Minor tweaks
This commit is contained in:
1 parent
2b8828dda4
commit
b813d49042
3 files changed
+20
-21
No files matched your search
@@ -46,7 +46,9 @@ bintray {
|
|||||||
userOrg = user
|
userOrg = user
|
||||||
desc = 'A handcrafted 1-1 Java binding for the Dear-ImGui'
|
desc = 'A handcrafted 1-1 Java binding for the Dear-ImGui'
|
||||||
licenses = ['Apache-2.0']
|
licenses = ['Apache-2.0']
|
||||||
vcsUrl = 'https://github.com/SpaiR/imgui-java'
|
websiteUrl = 'https://github.com/SpaiR/imgui-java'
|
||||||
|
issueTrackerUrl = 'https://github.com/SpaiR/imgui-java/issues'
|
||||||
|
vcsUrl = 'https://github.com/SpaiR/imgui-java.git'
|
||||||
labels = ['dear-imgui', 'java', 'jni']
|
labels = ['dear-imgui', 'java', 'jni']
|
||||||
githubRepo = 'SpaiR/imgui-java'
|
githubRepo = 'SpaiR/imgui-java'
|
||||||
publicDownloadNumbers = true
|
publicDownloadNumbers = true
|
||||||
|
|||||||
@@ -32,11 +32,6 @@ task sourcesJar(type: Jar, dependsOn: classes) {
|
|||||||
from sourceSets.main.allSource
|
from sourceSets.main.allSource
|
||||||
}
|
}
|
||||||
|
|
||||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
|
||||||
archiveClassifier.set('javadoc')
|
|
||||||
from javadoc.destinationDir
|
|
||||||
}
|
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
MyPublication(MavenPublication) {
|
MyPublication(MavenPublication) {
|
||||||
@@ -44,7 +39,6 @@ publishing {
|
|||||||
groupId 'io.imgui.java'
|
groupId 'io.imgui.java'
|
||||||
artifactId 'lwjgl3'
|
artifactId 'lwjgl3'
|
||||||
artifact sourcesJar
|
artifact sourcesJar
|
||||||
artifact javadocJar
|
|
||||||
version property('version')
|
version property('version')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,7 +55,9 @@ bintray {
|
|||||||
userOrg = user
|
userOrg = user
|
||||||
desc = 'Backend implementation for imgui-java based on LWJGL3'
|
desc = 'Backend implementation for imgui-java based on LWJGL3'
|
||||||
licenses = ['Apache-2.0']
|
licenses = ['Apache-2.0']
|
||||||
vcsUrl = 'https://github.com/SpaiR/imgui-java'
|
websiteUrl = 'https://github.com/SpaiR/imgui-java'
|
||||||
|
issueTrackerUrl = 'https://github.com/SpaiR/imgui-java/issues'
|
||||||
|
vcsUrl = 'https://github.com/SpaiR/imgui-java.git'
|
||||||
labels = ['dear-imgui', 'java', 'lwjgl3']
|
labels = ['dear-imgui', 'java', 'lwjgl3']
|
||||||
githubRepo = 'SpaiR/imgui-java'
|
githubRepo = 'SpaiR/imgui-java'
|
||||||
publicDownloadNumbers = true
|
publicDownloadNumbers = true
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import static org.lwjgl.system.MemoryUtil.NULL;
|
|||||||
|
|
||||||
@SuppressWarnings("MagicNumber")
|
@SuppressWarnings("MagicNumber")
|
||||||
public final class ImGuiGlfwExample {
|
public final class ImGuiGlfwExample {
|
||||||
private static final int DEFAULT_WIDTH = 1024;
|
private static final int DEFAULT_WIDTH = 1280;
|
||||||
private static final int DEFAULT_HEIGHT = 768;
|
private static final int DEFAULT_HEIGHT = 768;
|
||||||
|
|
||||||
private long window; // current GLFW window pointer
|
private long window; // current GLFW window pointer
|
||||||
@@ -80,7 +80,6 @@ public final class ImGuiGlfwExample {
|
|||||||
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE); // the window will stay hidden after creation
|
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE); // the window will stay hidden after creation
|
||||||
glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE); // the window will be resizable
|
glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE); // the window will be resizable
|
||||||
glfwWindowHint(GLFW_MAXIMIZED, GLFW_TRUE); // the window will be maximized
|
glfwWindowHint(GLFW_MAXIMIZED, GLFW_TRUE); // the window will be maximized
|
||||||
glfwWindowHint(GLFW_DECORATED, GLFW_TRUE); // the window will be decorated
|
|
||||||
|
|
||||||
// Create the window
|
// Create the window
|
||||||
window = glfwCreateWindow(DEFAULT_WIDTH, DEFAULT_HEIGHT, "ImGui+GLFW+LWJGL Example", NULL, NULL);
|
window = glfwCreateWindow(DEFAULT_WIDTH, DEFAULT_HEIGHT, "ImGui+GLFW+LWJGL Example", NULL, NULL);
|
||||||
@@ -249,22 +248,18 @@ public final class ImGuiGlfwExample {
|
|||||||
glfwSetCursor(window, mouseCursors[imguiCursor]);
|
glfwSetCursor(window, mouseCursors[imguiCursor]);
|
||||||
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||||
|
|
||||||
// Render itself starts here
|
// Clear the framebuffer
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // clear the framebuffer
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
// IMPORTANT!!
|
// IMPORTANT!!
|
||||||
// Any ImGui code SHOULD go between NewFrame()/Render() methods
|
// Any ImGui code SHOULD go between NewFrame()/Render() methods
|
||||||
ImGui.newFrame();
|
ImGui.newFrame();
|
||||||
showUi();
|
showUi(); // ImGui calls goes here
|
||||||
ImGui.end();
|
|
||||||
|
|
||||||
if (showDemoWindow.get()) {
|
|
||||||
ImGui.showDemoWindow(showDemoWindow);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.render();
|
ImGui.render();
|
||||||
|
|
||||||
imGuiGl3.render(ImGui.getDrawData()); // render DrawData from ImGui into our OpenGL context
|
// After ImGui#render call we provide draw data into LWJGL3 render.
|
||||||
|
// At that moment ImGui will be rendered to the current OpenGL context.
|
||||||
|
imGuiGl3.render(ImGui.getDrawData());
|
||||||
|
|
||||||
glfwSwapBuffers(window); // swap the color buffers
|
glfwSwapBuffers(window); // swap the color buffers
|
||||||
|
|
||||||
@@ -277,7 +272,7 @@ public final class ImGuiGlfwExample {
|
|||||||
ImGui.setNextWindowSize(600, 300, ImGuiCond.Once);
|
ImGui.setNextWindowSize(600, 300, ImGuiCond.Once);
|
||||||
ImGui.setNextWindowPos(10, 10, ImGuiCond.Once);
|
ImGui.setNextWindowPos(10, 10, ImGuiCond.Once);
|
||||||
|
|
||||||
ImGui.begin("Custom window");
|
ImGui.begin("Custom window"); // Start Custom window
|
||||||
ImGui.text("Hello from Java!");
|
ImGui.text("Hello from Java!");
|
||||||
|
|
||||||
ImGui.button("Drag me");
|
ImGui.button("Drag me");
|
||||||
@@ -324,6 +319,12 @@ public final class ImGuiGlfwExample {
|
|||||||
if (ImGui.button("Copy")) {
|
if (ImGui.button("Copy")) {
|
||||||
ImGui.setClipboardText(imguiDemoLink);
|
ImGui.setClipboardText(imguiDemoLink);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui.end(); // End Custom window
|
||||||
|
|
||||||
|
if (showDemoWindow.get()) {
|
||||||
|
ImGui.showDemoWindow(showDemoWindow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If you want to clean a room after yourself - do it by yourself
|
// If you want to clean a room after yourself - do it by yourself
|
||||||
|
|||||||
Reference in new issue
Block a user