Git Product home page Git Product logo

imgui's Issues

NoSuchMethodError STBRPRect

Hi !
Since I refresh my gradle project, I have a NoSuchMethodError.
This is the stacktrace :
Caused by: java.lang.NoSuchMethodError: org.lwjgl.stb.STBRPRect.was_packed()I at imgui.stb.ExtensionsKt.getWasPacked(extensions.kt:14) at imgui.FontAtlas.buildPackCustomRects(font.kt:821) at imgui.FontAtlas.buildWithStbTrueType(font.kt:633) at imgui.FontAtlas.build(font.kt:243) at imgui.FontAtlas.getTexDataAsAlpha8(font.kt:252) at imgui.FontAtlas.getTexDataAsRGBA32(font.kt:262) at imgui.impl.LwjglGL3.createFontsTexture(LwjglGL3.kt:245) at imgui.impl.LwjglGL3.createDeviceObjects(LwjglGL3.kt:176) at imgui.impl.LwjglGL3.newFrame(LwjglGL3.kt:108)
Thanks, Catvert.

Fat jar fails loading

Fat jar 1.52 works fine, but 1.53 wip beta 03 fails to load with

`[LWJGL] Version: 3.1.5 SNAPSHOT

[LWJGL] OS: Windows 10 v10.0

[LWJGL] JRE: 1.8.0_144 amd64

[LWJGL] JVM: Java HotSpot(TM) 64-Bit Server VM v25.144-b01 by Oracle Corporation

[LWJGL] Loading library (system): lwjgl

[LWJGL] lwjgl.dll not found in java.library.path

[LWJGL] Failed to load a library. Possible solutions:

a) Add the directory that contains the shared library to -Djava.library.path or -Dorg.lwjgl.librarypath.

b) Add the JAR that contains the shared library to the classpath.

Exception in thread "main" java.lang.UnsatisfiedLinkError: Failed to locate library: lwjgl.dll

at org.lwjgl.system.Library.loadSystem(Library.java:146)

at org.lwjgl.system.Library.loadSystem(Library.java:66)

at org.lwjgl.system.Library.<clinit>(Library.java:49)

at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:60)

at uno.buffer.BufferKt.intBufferBig(buffer.kt:21)

at imgui.impl.LwjglGL3.<clinit>(LwjglGL3.kt:63)

at com.sylvyrfysh.monerowallet.MoneroWalletMain.<init>(MoneroWalletMain.java:23)

at com.sylvyrfysh.monerowallet.MoneroWalletMain.main(MoneroWalletMain.java:18)

`

Is LWJGL a required dependency?

Hi,
im currently in the progress of writing a binding for JME3. I noticed, that upon creating the Font
fontTexture = IO.INSTANCE.getFonts().getTexDataAsRGBA32();
I get an expection:

java.lang.NoClassDefFoundError: org/lwjgl/system/MemoryUtil
	at uno.buffer.BufferKt.bufferBig(buffer.kt:18)
	at imgui.FontAtlas.addFontFromMemoryTTF(font.kt:160)
	at imgui.FontAtlas.addFontFromMemoryCompressedTTF(font.kt:176)
	at imgui.FontAtlas.addFontFromMemoryCompressedBase85TTF(font.kt:185)
	at imgui.FontAtlas.addFontDefault(font.kt:147)
	at imgui.FontAtlas.addFontDefault(font.kt:138)
	at imgui.FontAtlas.getTexDataAsAlpha8(font.kt:242)
	at imgui.FontAtlas.getTexDataAsRGBA32(font.kt:253)
	at ImGuiState.initialize(ImGuiState.java:25)
	at com.jme3.app.state.BaseAppState.initialize(BaseAppState.java:124)
	at com.jme3.app.state.AppStateManager.initializePending(AppStateManager.java:251)
	at com.jme3.app.state.AppStateManager.update(AppStateManager.java:281)
	at com.jme3.app.SimpleApplication.update(SimpleApplication.java:236)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
	at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:197)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:232)
	at java.lang.Thread.run(Thread.java:812)
Caused by: java.lang.ClassNotFoundException: org.lwjgl.system.MemoryUtil
	at java.net.URLClassLoader.findClass(URLClassLoader.java:444)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:490)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:376)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
	... 17 more

So the question is, is lwjgl required for this?
Or is there some way I can configure the system to use a different buffer implementation?
Reason is, that I try to only use the official JME3 api for the binding in the hope that it will also work with jogl ect.
Greetings, Empire

Extra fonts & issue with lwjgl-stb natives

There seems to be two copies of the fonts in the -SNAPSHOT version. See here: https://i.imgur.com/34H4lWg.png

And ArialUni takes up 22MB! I was wondering why my jar file was so big. This is easily removed but I think you could get rid of it

On another note:

I also ran into a problem getting it to work on windows with LWJGL-3.1.7-SNAPSHOT(using libgdx 1.9.8). It could not find the native windows files for lwjgl-stb. It only exists up to 3.1.6 on the maven repository.. but strangely there is a linux natives for 3.1.7. I had to use the 3.1.6 stb version which gives a warning on startup but it seems to be working now.

java.lang.NullPointerException

After some days of porting my application to the latest LWJGL version, I tried to use Dear ImGui with it.
I got a bit confused since in the readme it says you only have to initialize elements and render them, but in the tests of the wiki you are using your own GlfwWindow, and this makes it hard for me since I need a way to port my original glfw window, as a long, to the GlfwWindow.

My code is here:

@Override
 public void drawScreen(int mouseX, int mouseY, float partialTicks) {
        ImGui.INSTANCE.newFrame();

        float[] f = {0f};
        int[] i = {0};

        ImGui.INSTANCE.text("Hello, world %d", 123);

        if (ImGui.INSTANCE.button("OK", new Vec2(20, 20))) {
            System.out.println("OK Button Pressed!");
        }

        ImGui.INSTANCE.sliderFloat("float", f, 0f, 1f, "display format", 0.5f);
        ImGui.INSTANCE.sliderInt("int", i, 0, 100, "display format");

        ImGui.INSTANCE.render();
    }

The exception being thrown is here:

java.lang.NullPointerException: Rendering screen
	at imgui.ImguiKt.getG(imgui.kt:22)
	at imgui.imgui.imgui_main$DefaultImpls.newFrame(main.kt:47)
	at imgui.ImGui.newFrame(imgui.kt:44)
	at <REDACTED>.ClickGUIScreen.drawScreen(ClickGUIScreen.java:61)

demos or examples?

Can you please provide some demos or samples so I can use imgui with kotlin?

Thank you!

Shader loading fails when using a jar version of the library

I get an exception in Program.kt around line 294:
val lines = File(url.toURI()).readLines()

Looking at the url it looks like:

jar:file:/C:/Users/<myusername>/.m2/repository/com/github/kotlin-graphics/imgui/-v1.51-gfcc47f9-11/imgui--v1.51-gfcc47f9-11.jar!/shader.vert

It might be an issue exposed when grabbing imgui as a jar file from maven rather than referring directly to the code. It seems Files can't be created from a path pointing into a jar.
Using url.openStream() seem to solve this in my local tests (I don't have an environment allowing me to rebuild the imgui sources at this point so I have not tried it on the imgui code)

Problem with IDs and imageButtons

Hi !

I've found an issue when I use a lot of imageButtons. The program don't crash but imageButtons (the latter, I assume greater than 256 or 512) become unresponsive to the click (and only imageButtons, other elements are responsive as well). The problem is propagated to all windows on the screen having imageButtons.

Thanks for your help,
Catvert.

Crash while navigating metrics in demo window

Issue in commit f95d10c

Go to (Help > Metrics > Internal State) then either scroll to the bottom or resize the window to see the bottom of Internal State. Doing so gives the following exception.

java.lang.IndexOutOfBoundsException: Index -1 out-of-bounds for length 225
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
	at java.base/java.util.Objects.checkIndex(Objects.java:372)
	at java.base/java.util.ArrayList.get(ArrayList.java:440)
	at imgui.Font.findGlyph(font.kt:992)
	at imgui.Font.findGlyph(font.kt:991)
	at imgui.Font.renderText(font.kt:1288)
	at imgui.DrawList.addText(draw.kt:325)
	at imgui.DrawList.addText$default(draw.kt:300)
	at imgui.imgui.imgui_internal$DefaultImpls.renderTextWrapped(internal.kt:1056)
	at imgui.ImGui.renderTextWrapped(imgui.kt:45)
	at imgui.imgui.imgui_widgetsText$DefaultImpls.textUnformatted(widgets text.kt:124)
	at imgui.ImGui.textUnformatted(imgui.kt:45)
	at imgui.imgui.imgui_widgetsText$DefaultImpls.textV(widgets text.kt:138)
	at imgui.ImGui.textV(imgui.kt:45)
	at imgui.imgui.imgui_widgetsText$DefaultImpls.text(widgets text.kt:128)
	at imgui.ImGui.text(imgui.kt:45)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showMetricsWindow(demo debug informations.kt:136)
	at imgui.ImGui.showMetricsWindow(imgui.kt:45)
	at imgui.imgui.demo.ExampleApp.invoke(ExampleApp.kt:84)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:91)
	at imgui.ImGui.showDemoWindow(imgui.kt:45)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:87)
	at imgui.ImGui.showDemoWindow(imgui.kt:45)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.loop(VRScene.java:750)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.lambda$run$0(VRScene.java:271)
	at uno.glfw.GlfwWindow.loop(GlfwWindow.kt:503)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.run(VRScene.java:270)
	at java.base/java.lang.Thread.run(Thread.java:844)

MemoryStack leak in v1.6.3-beta-02

The thread local MemoryStack is leaking frames and leads to an OutOfMemoryError. This isn't present in v1.6.3-beta-01.

Reproduce when running the LWJGL example by printing MemoryStack.stackGet().pointer in the main loop - on beta-01 this remains constant (as it should) but on beta-02 falls to 0 and crashes.

Docking windows

Would be nice to be able to dock windows (attaching one window to another), being able to drag windows to create tabs so the user can modify the UI as he pleases.

Something like: ocornut/imgui#970

But adding the possibility to attach a window to the left/top/right/down side so it will also resize when the windows application is resized.

JME3: Init

So I finally managed to get the dependencies working proerply in combination with jme3 :)

	@Override
	protected void initialize(Application app) {
		this.rendererapp = app;
		ImGui.INSTANCE.initialize();
		fontTexture = IO.INSTANCE.getFonts().getTexDataAsRGBA32();
                //TODO pack into jme texture and upload after this
	}

I try to roughly follow the generic lwjgl3 binding already provided, but bring it into a jme appstate.
Am I missing some other required call in before?

I get some kind of assertion from the depth of the font system, sadly I do not really understand the reason for this:

fontAtlas.class@461
    fun addCustomRectRegular(id: Int, width: Int, height: Int): Int {
        assert(id >= 0x10000 && width in 0..0xFFFF && height in 0..0xFFFF)
        val r = CustomRect()
        r.id = id
        r.width = width
        r.height = height
        customRects.add(r)
        return customRects.lastIndex
    }

width is 181, height is 27, but id is -2147483648.
The call comes from here:

    fun buildRegisterDefaultCustomRects() {
        if (customRectIds[0] < 0)
            customRectIds[0] = addCustomRectRegular(DefaultTexData.id, DefaultTexData.wHalf * 2 + 1, DefaultTexData.h)
    }

Sadly I'm missing kotlin knowledge & ide support support a bit, and cannot figure out why the id has that value (or where it actually comes from)

LibGDX example not working

Hi, I'd like to use imgui with LibGDX, but couldn't find any minimal example. And the current steps in the Wiki do not work for me.

My current code is in this repository (and I'd like to be able to provide a working minimal example project for others too):
https://github.com/klianc09/imguiexample

I added the dependencies to the generated project, as documented in the Wiki.
However when trying to run I get the following error message:

$ ./gradlew lwjgl3:run
Configuration on demand is an incubating feature.
Download https://jitpack.io/com/github/kotlin-graphics/imgui/-SNAPSHOT/maven-metadata.xml

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':core:compileClasspath'.
> Could not find com.github.kotlin-graphics:imgui:-SNAPSHOT.
  Searched in the following locations:
  file:/home/toni/.m2/repository/com/github/kotlin-graphics/imgui/-SNAPSHOT/maven-metadata.xml
  file:/home/toni/.m2/repository/com/github/kotlin-graphics/imgui/-SNAPSHOT/imgui--SNAPSHOT.pom
  file:/home/toni/.m2/repository/com/github/kotlin-graphics/imgui/-SNAPSHOT/imgui--SNAPSHOT.jar
  https://repo1.maven.org/maven2/com/github/kotlin-graphics/imgui/-SNAPSHOT/maven-metadata.xml
  https://repo1.maven.org/maven2/com/github/kotlin-graphics/imgui/-SNAPSHOT/imgui--SNAPSHOT.pom
  https://repo1.maven.org/maven2/com/github/kotlin-graphics/imgui/-SNAPSHOT/imgui--SNAPSHOT.jar
  https://jcenter.bintray.com/com/github/kotlin-graphics/imgui/-SNAPSHOT/maven-metadata.xml
  https://jcenter.bintray.com/com/github/kotlin-graphics/imgui/-SNAPSHOT/imgui--SNAPSHOT.pom
  https://jcenter.bintray.com/com/github/kotlin-graphics/imgui/-SNAPSHOT/imgui--SNAPSHOT.jar
  https://oss.sonatype.org/content/repositories/snapshots/com/github/kotlin-graphics/imgui/-SNAPSHOT/maven-metadata.xml
  https://oss.sonatype.org/content/repositories/snapshots/com/github/kotlin-graphics/imgui/-SNAPSHOT/imgui--SNAPSHOT.pom
  https://oss.sonatype.org/content/repositories/snapshots/com/github/kotlin-graphics/imgui/-SNAPSHOT/imgui--SNAPSHOT.jar
  https://jitpack.io/com/github/kotlin-graphics/imgui/-SNAPSHOT/maven-metadata.xml
  https://jitpack.io/com/github/kotlin-graphics/imgui/-SNAPSHOT/imgui--v1.60wip-beta-02-g789514e-20.pom
  https://jitpack.io/com/github/kotlin-graphics/imgui/-SNAPSHOT/imgui--v1.60wip-beta-02-g789514e-20.jar
  https://dl.bintray.com/kotlin/kotlin-dev/com/github/kotlin-graphics/imgui/-SNAPSHOT/maven-metadata.xml
  https://dl.bintray.com/kotlin/kotlin-dev/com/github/kotlin-graphics/imgui/-SNAPSHOT/imgui--SNAPSHOT.pom
  https://dl.bintray.com/kotlin/kotlin-dev/com/github/kotlin-graphics/imgui/-SNAPSHOT/imgui--SNAPSHOT.jar
Required by:
  project :core

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED in 16s
1 actionable task: 1 executed

Any pointers would be appreciated.

Crash in vertical sliders in demo window

This is using v1.62-beta-02.

In the demo window if I go (Widgets > Vertical Sliders) and try to move any of the sliders I get the following exception.

Exception in thread "hmd-renderer" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
	at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:44)
	at java.base/java.lang.String.charAt(String.java:704)
	at imgui.imgui.imgui_internal$DefaultImpls.parseFormatFindStart(internal.kt:3283)
	at imgui.ImGui.parseFormatFindStart(imgui.kt:45)
	at imgui.imgui.imgui_internal$Companion.roundScalarWithFormat(internal.kt:3459)
	at imgui.imgui.imgui_internal$DefaultImpls.sliderBehaviorT(internal.kt:1972)
	at imgui.ImGui.sliderBehaviorT(imgui.kt:45)
	at imgui.imgui.imgui_internal$DefaultImpls.sliderBehavior(internal.kt:1548)
	at imgui.ImGui.sliderBehavior(imgui.kt:45)
	at imgui.imgui.imgui_widgetsSliders$DefaultImpls.vSliderScalar(widgets sliders.kt:258)
	at imgui.ImGui.vSliderScalar(imgui.kt:45)
	at imgui.imgui.imgui_widgetsSliders$DefaultImpls.vSliderFloat(widgets sliders.kt:221)
	at imgui.ImGui.vSliderFloat(imgui.kt:45)
	at imgui.imgui.imgui_widgetsSliders$DefaultImpls.vSliderFloat$default(widgets sliders.kt:220)
	at imgui.imgui.demo.widgets.invoke(widgets.kt:987)
	at imgui.imgui.demo.ExampleApp.invoke(ExampleApp.kt:241)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:89)
	at imgui.ImGui.showDemoWindow(imgui.kt:45)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:85)
	at imgui.ImGui.showDemoWindow(imgui.kt:45)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.loop(VRScene.java:748)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.lambda$run$0(VRScene.java:260)
	at uno.glfw.GlfwWindow.loop(GlfwWindow.kt:492)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.run(VRScene.java:259)
	at java.base/java.lang.Thread.run(Thread.java:844)

Conflicting dependencies when using maven ?

Hello! After a few failed attempts at getting the dependency to work, I just can't wrap my head around it. Following the instructions from the README, adding jitpack and then imgui, just appears to produce conflicts between dependencies, making the project unbuildable.

My pom.xml: https://pastebin.com/mxnCas3S
Conflicts highlighted in intelliJ:
image
Maven log when attempting to mvn install: https://pastebin.com/UKbxJXuR

My code is a simple LWJGL loop and the sample imgui (java) code provided with the README.

I attempted excluding the dependencies myself, and adding them separately after. This only resulted in my test app launching, showing a white window for roughly a second, and then closing without a stacktrace (as if System.exit(0); was called)

My apologies if I'm missing something big, or if this isn't the right place to post this.
Thanks in advance.

switch fullscreen/window mode crash imgui

Hi !
When I switch the game to full screen in game, imgui crash with this error:
Exception in thread "main" kotlin.KotlinNullPointerException at imgui.imgui.imgui_internal$DefaultImpls.getCurrentWindow(internal.kt:105) at imgui.ImGui.getCurrentWindow(imgui.kt:27) at imgui.imgui.imgui_parametersStacks$DefaultImpls.popItemWidth(parameters stacks.kt:230) at imgui.ImGui.popItemWidth(imgui.kt:27) at be.catvert.pc.scenes.MainMenuScene$drawSettingsWindow$$inlined$with$lambda$1.invoke(MainMenuScene.kt:257) at be.catvert.pc.scenes.MainMenuScene$drawSettingsWindow$$inlined$with$lambda$1.invoke(MainMenuScene.kt:26) at be.catvert.pc.utility.ImGuiHelper.withCenteredWindow(ImGuiHelper.kt:381) at be.catvert.pc.utility.ImGuiHelper.withCenteredWindow$default(ImGuiHelper.kt:377) at be.catvert.pc.scenes.MainMenuScene.drawSettingsWindow(MainMenuScene.kt:192) at be.catvert.pc.scenes.MainMenuScene.drawUI(MainMenuScene.kt:54) at be.catvert.pc.scenes.MainMenuScene.render(MainMenuScene.kt:42) at be.catvert.pc.scenes.SceneManager.render(SceneManager.kt:96) at be.catvert.pc.PCGame.render(PCGame.kt:101) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:392) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:137) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:111) at be.catvert.pc.Lwjgl3Launcher.main(Lwjgl3Launcher.kt:34)

I tried several solutions to fix the problem, like relaunching a new frame, end the window before the switch, ... but nothing works: (

Using ImGui with existing lwjgl

Hello,

we have existing java framework that uses lwjgl for its rendering.
We want to create editor on top of it using imgui. But imgui also runs on lwjgl.

The only gradle dependency I have is imgui, so no lwjgl, since it is already included inside .jar of our framework.

The issue is, when I run the application, our framework initialized glfw and creates its window.
Then when I create my own new glfw window and call lwjglGL3.newFrame(), it crashes on

Exception in thread "main" java.lang.NoSuchMethodError: org.lwjgl.opengl.GL30.glGetInteger(I)I
	at imgui.impl.LwjglGL3.createDeviceObjects(LwjglGL3.kt:210)
	at imgui.impl.LwjglGL3.newFrame(LwjglGL3.kt:103)
	at sk.greentube.DiceTimerApplet.tick(DiceTimerApplet.java:143)

which I presume is caused by mixed lwjgl versions. Could you please help me fix it? Or what dependencies should I have inside Idea so both our framework and imgui runs at the same time (same thread)

This is code snippet I use. tick() is called after our framework initializes GLFW and creates its window.

    @Override
    public void tick() {
        if(windowPointer == 0){
            GLFW.glfwDefaultWindowHints();
            windowPointer = GLFW.glfwCreateWindow(500, 500, "IMGUI", 0, 0);
            GLFW.glfwMakeContextCurrent(windowPointer);
        }
        
        GLFW.glfwMakeContextCurrent(windowPointer);
        lwjglGL3.newFrame(); // CRASH HERE

        int backBufferTextureId = GLMain.backBufferTextureId;
        int backBuffer = GLMain.backBuffer;
        imgui.text("Novo back buffer: " + backBuffer);
        imgui.text("Novo Pointer: " + backBufferTextureId);
        imgui.text("ImGui Pointer: " + windowPointer);
        imgui.image(backBufferTextureId, new Vec2(300, 300), new Vec2(0, 0), new Vec2(1, 1), new Vec4(1, 1, 1, 1), new Vec4(1, 1, 1, 1));


        gln.GlnKt.glViewport(500, 500);
        gln.GlnKt.glClearColor(new Vec4(0.45f, 0.55f, 0.6f, 1f));
        GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);

        imgui.render();
        lwjglGL3.renderDrawData(imgui.getDrawData());

        glfwSwapBuffers(windowPointer);
    }

Thank you

Demo window NoSuchMethodError

Issue in commit fd68422
Tested and don't have the issue in commit 5576911

When navigating to (Widgets > Basics) in demo window I get the following error.

java.lang.NoSuchMethodError: glm_.vec2.Vec2.anyGreaterThanEqual(Lglm_/vec2/Vec2t;)Z
	at imgui.imgui.imgui_window$DefaultImpls.begin(window.kt:678)
	at imgui.ImGui.begin(imgui.kt:53)
	at imgui.Static_funcsKt.beginChildEx(static funcs.kt:772)
	at imgui.imgui.imgui_window$DefaultImpls.beginChild(window.kt:734)
	at imgui.ImGui.beginChild(imgui.kt:53)
	at imgui.imgui.imgui_utilities$DefaultImpls.beginChildFrame(utilities.kt:219)
	at imgui.ImGui.beginChildFrame(imgui.kt:53)
	at imgui.imgui.imgui_utilities$DefaultImpls.beginChildFrame$default(utilities.kt:213)
	at imgui.imgui.imgui_widgetsSelectableLists$DefaultImpls.listBoxHeader(widgets selectableLists.kt:211)
	at imgui.ImGui.listBoxHeader(imgui.kt:53)
	at imgui.imgui.imgui_widgetsSelectableLists$DefaultImpls.listBoxHeader(widgets selectableLists.kt:229)
	at imgui.ImGui.listBoxHeader(imgui.kt:53)
	at imgui.imgui.imgui_widgetsSelectableLists$DefaultImpls.listBox(widgets selectableLists.kt:166)
	at imgui.ImGui.listBox(imgui.kt:53)
	at imgui.imgui.demo.widgets.invoke(widgets.kt:402)
	at imgui.imgui.demo.ExampleApp.invoke(ExampleApp.kt:180)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:91)
	at imgui.ImGui.showDemoWindow(imgui.kt:53)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:87)
	at imgui.ImGui.showDemoWindow(imgui.kt:53)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.loop(VRScene.java:749)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.lambda$run$0(VRScene.java:265)
	at uno.glfw.GlfwWindow.loop(GlfwWindow.kt:503)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.run(VRScene.java:264)
	at java.base/java.lang.Thread.run(Thread.java:844)

Imgui should not depend on platform specifc native libraries

Currently, the generated POM lists platform specific binaries as dependency (the LWJGL linux natives to be more specific). Since in reality imgui does not depend on a single platform this is bad behavior and unnecessary noise in the dependency graph.
I suggest making those binaries test dependencies and instruct users to add the following snippet (or something similiar) to their buildscripts:

import org.gradle.internal.os.OperatingSystem

apply plugin: 'java'
apply plugin: 'kotlin'

repositories {
    mavenCentral()
    maven { url "https://dl.bintray.com/kotlin/kotlin-dev" }
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    maven { url 'https://jitpack.io' }
}

dependencies {
    compile 'com.github.kotlin-graphics:imgui:-SNAPSHOT'
	
    switch ( OperatingSystem.current() ) {
        case OperatingSystem.WINDOWS:
            ext.lwjglNatives = "natives-windows"
            break
        case OperatingSystem.LINUX:
            ext.lwjglNatives = "natives-linux"
            break
        case OperatingSystem.MAC_OS:
            ext.lwjglNatives = "natives-macos"
            break
    }

    // Look up which modules and versions of LWJGL are required and add setup the approriate natives.
    configurations.compile.resolvedConfiguration.getResolvedArtifacts().forEach {
        if (it.moduleVersion.id.group == "org.lwjgl") {
            runtime "org.lwjgl:${it.moduleVersion.id.name}:${it.moduleVersion.id.version}:${lwjglNatives}"
        }
    }
}

Using libGDX

Hi, I can't find a way to make this library work with libGDX (which also allows to use LWGL3).
Thank you for your help.

ImGui with Libgdx on Mac OS X

I'm going to build an editor for my game on Libgdx and found that imgui can help a lot in that.
My game is targeting Open GL ES 2.0 devices (including mobile phones). The editor should be able to run on Mac OS X and Windows.
I was able to run Lwjgl3 implementation of ImGui together with a simple libgdx project after several hours of trials and errors, but I see which troubles will I meet, when I try to integrate ImGui into existing project.

Points:

  1. Current ImGui implementation is based on GL3.
  2. That means that I have to configure Lwjgl to use OpenGL 3.2 API
  3. Once I configure it to use OpenGL 3.2 on Mac OS X, there seems to be no way to use earlier versions of OpenGL.
  4. Shader of LibGDX/SpriteBatch is not compatible with OpenGL 3.2 API (I had to rewrite it to use 'in' and 'out' instead of 'attribute' and 'varying')
  5. I have custom shaders in my game and they are targeting OpenGL ES 2.0. That means I can't test my shaders in the editor (and I have to find workarounds, like automatically rewrite old shaders to use in/out, when I run it on desktop)
  6. All that means that I can't use OpenGL 3.2 API and have to stick to OpenGL 2.0 API.
  7. As I can see it is big stop for LibGDX users (probably the largest set of potential users of ImGui)

Questions:

  1. Do I miss something?
  2. If I don't miss, is it a lot of work to add an implementation for OpenGL 2.0 in ImGui?

Stable branch of Kotlin support

It seems this is dependent on a future and/or experimental version of Kotlin in the 1.2 branch leading to gradle import failure, if used in a non-experimental project.

Warning:<i><b>project ':core': Unable to build Kotlin project configuration</b> Details: java.lang.reflect.InvocationTargetException: null Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':core:compileClasspath'. Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find org.jetbrains.kotlin:kotlin-stdlib:1.2.0-beta-88.

Current version of Kotlin as of Nov 6, 2017 is 1.1.51

Is there any way to get around this without having to fork it?

Crashes in style editor

This is using v1.62-beta-02.

In the demo window if you go (Help > Style Editor > Rendering) then click and drag the Curve Tesselation Tolerance button I crash with the following exception.

Exception in thread "hmd-renderer" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
	at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:44)
	at java.base/java.lang.String.charAt(String.java:704)
	at imgui.imgui.imgui_internal$DefaultImpls.parseFormatFindStart(internal.kt:3283)
	at imgui.ImGui.parseFormatFindStart(imgui.kt:45)
	at imgui.imgui.imgui_internal$Companion.roundScalarWithFormat(internal.kt:3459)
	at imgui.imgui.imgui_main$Companion.dragBehaviorT(main.kt:862)
	at imgui.imgui.imgui_internal$DefaultImpls.dragBehavior(internal.kt:1509)
	at imgui.ImGui.dragBehavior(imgui.kt:45)
	at imgui.imgui.imgui_widgetsDrag$DefaultImpls.dragScalar(widgets drags.kt:266)
	at imgui.ImGui.dragScalar(imgui.kt:45)
	at imgui.imgui.imgui_widgetsDrag$DefaultImpls.dragFloat(widgets drags.kt:58)
	at imgui.ImGui.dragFloat(imgui.kt:45)
	at imgui.imgui.demo.StyleEditor.invoke(ExampleApp.kt:1138)
	at imgui.imgui.demo.StyleEditor.invoke$default(ExampleApp.kt:1090)
	at imgui.imgui.demo.ExampleApp.invoke(ExampleApp.kt:155)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:89)
	at imgui.ImGui.showDemoWindow(imgui.kt:45)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:85)
	at imgui.ImGui.showDemoWindow(imgui.kt:45)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.loop(VRScene.java:743)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.lambda$run$0(VRScene.java:260)
	at uno.glfw.GlfwWindow.loop(GlfwWindow.kt:492)

Likewise if you go (Help > Style Editor > Fonts > Glyphs) I crash with get he following exception.

Exception in thread "hmd-renderer" java.lang.IndexOutOfBoundsException: Index -1 out-of-bounds for length 225
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
	at java.base/java.util.Objects.checkIndex(Objects.java:372)
	at java.base/java.util.ArrayList.get(ArrayList.java:440)
	at imgui.Font.findGlyphNoFallback(font.kt:978)
	at imgui.Font.findGlyphNoFallback(font.kt:977)
	at imgui.imgui.demo.StyleEditor.invoke(ExampleApp.kt:1275)
	at imgui.imgui.demo.StyleEditor.invoke$default(ExampleApp.kt:1090)
	at imgui.imgui.demo.ExampleApp.invoke(ExampleApp.kt:155)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:89)
	at imgui.ImGui.showDemoWindow(imgui.kt:45)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:85)
	at imgui.ImGui.showDemoWindow(imgui.kt:45)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.loop(VRScene.java:743)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.lambda$run$0(VRScene.java:260)
	at uno.glfw.GlfwWindow.loop(GlfwWindow.kt:492)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.run(VRScene.java:259)
	at java.base/java.lang.Thread.run(Thread.java:844)

Crash on sliders with units

This is using v1.62-beta-02.

In the demo window if I go e.g. (Widgets > Range WIdgets) or (Widgets > Basics) and try to move any of the sliders with text after the number I get the following exception.

Exception in thread "hmd-renderer" java.lang.NumberFormatException: For input string: "0.006700 ns"
	at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
	at java.base/jdk.internal.math.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
	at java.base/java.lang.Float.parseFloat(Float.java:455)
	at glm_.ExtensionsKt.getF(extensions.kt:207)
	at imgui.imgui.imgui_internal$Companion.roundScalarWithFormat(internal.kt:3463)
	at imgui.imgui.imgui_main$Companion.dragBehaviorT(main.kt:862)
	at imgui.imgui.imgui_internal$DefaultImpls.dragBehavior(internal.kt:1509)
	at imgui.ImGui.dragBehavior(imgui.kt:45)
	at imgui.imgui.imgui_widgetsDrag$DefaultImpls.dragScalar(widgets drags.kt:266)
	at imgui.ImGui.dragScalar(imgui.kt:45)
	at imgui.imgui.imgui_widgetsDrag$DefaultImpls.dragFloat(widgets drags.kt:58)
	at imgui.ImGui.dragFloat(imgui.kt:45)
	at imgui.imgui.imgui_widgetsDrag$DefaultImpls.dragFloat$default(widgets drags.kt:57)
	at imgui.imgui.demo.widgets.invoke(widgets.kt:351)
	at imgui.imgui.demo.ExampleApp.invoke(ExampleApp.kt:241)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:89)
	at imgui.ImGui.showDemoWindow(imgui.kt:45)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:85)
	at imgui.ImGui.showDemoWindow(imgui.kt:45)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.loop(VRScene.java:748)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.lambda$run$0(VRScene.java:260)
	at uno.glfw.GlfwWindow.loop(GlfwWindow.kt:492)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.run(VRScene.java:259)
	at java.base/java.lang.Thread.run(Thread.java:844)

Crash on sliders sliding into the negative

Found in commit 297e44d
Related to #47 #48

Every time a slider has a negative value the following exception happens.

(Widgets > Basics)
Exception in thread "hmd-renderer" java.text.ParseException: Unparseable number: "-2%"
	at java.base/java.text.NumberFormat.parse(NumberFormat.java:393)
	at imgui.imgui.imgui_internal$Companion.roundScalarWithFormat(internal.kt:3498)
	at imgui.imgui.imgui_main$Companion.dragBehaviorT(main.kt:658)
	at imgui.imgui.imgui_internal$DefaultImpls.dragBehavior(internal.kt:1552)
	at imgui.ImGui.dragBehavior(imgui.kt:45)
	at imgui.imgui.imgui_widgetsDrag$DefaultImpls.dragScalar(widgets drags.kt:266)
	at imgui.ImGui.dragScalar(imgui.kt:45)
	at imgui.imgui.imgui_widgetsDrag$DefaultImpls.dragScalar$default(widgets drags.kt:212)
	at imgui.imgui.imgui_widgetsDrag$DefaultImpls.dragInt(widgets drags.kt:133)
	at imgui.ImGui.dragInt(imgui.kt:45)
	at imgui.imgui.demo.widgets.invoke(widgets.kt:378)
	at imgui.imgui.demo.ExampleApp.invoke(ExampleApp.kt:180)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:91)
	at imgui.ImGui.showDemoWindow(imgui.kt:45)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:87)
	at imgui.ImGui.showDemoWindow(imgui.kt:45)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.loop(VRScene.java:748)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.lambda$run$0(VRScene.java:270)
	at uno.glfw.GlfwWindow.loop(GlfwWindow.kt:503)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.run(VRScene.java:269)
	at java.base/java.lang.Thread.run(Thread.java:844)

This happens for every slider I tried that allows me to slide the value into the negative.

DEMO EXCEPTION: Unparseable number: "-0.0004"
DEMO EXCEPTION: Unparseable number: "-59 deg"
DEMO EXCEPTION: Unparseable number: "-0.008700 ns"
DEMO EXCEPTION: Unparseable number: "-425 units"
DEMO EXCEPTION: Unparseable number: "-60"

Recent fat jar loads fail

I have tried building my own, and using the provided jars, but all the recent fat jars fail.
The issue is with the GLFW library, setting the uno-sdk to sha 040f71aaf6ac580925f66cb86bbb3a98d40b0646 (right before changing getTime to float) and then fixing callbacks works. I cannot seem to fix this, traces are

Exception in thread "Thread-0" java.lang.NoSuchMethodError: uno.glfw.GlfwWindow.setScrollCallBack(Lkotlin/jvm/functions/Function2;)V
	at imgui.impl.LwjglGL3.init(LwjglGL3.kt:103)

Setting init's second argument to false, therefore bypassing scrollCallback brings up

Exception in thread "Thread-0" java.lang.NoSuchMethodError: uno.glfw.glfw.getTime()F
	at imgui.impl.LwjglGL3.newFrame(LwjglGL3.kt:127)

inputText issues

Report will use example as reference.

static char[][] buf=new char[3][255];
boolean[] windowOpen=new boolean[1];

private void init() {
	buf[0][0]='a';
}

public void loop(){
	glfw.pollEvents();
	lwjglGL3.newFrame();
	float w=window.getFramebufferSize().x,h=window.getFramebufferSize().y;
	imgui.setNextWindowPos(new Vec2((w-350)/2,(h-350)/2), Cond.FirstUseEver, new Vec2());
	imgui.setNextWindowSize(new Vec2(350,350), Cond.FirstUseEver);
	if(imgui.begin("Test", windowOpen, 0)) {
		imgui.text("Test");
		for(int i=0;i<buf.length;i++) {
			imgui.text(String.valueOf(i));
			imgui.inputText("", buf[i], InputTextFlags.EnterReturnsTrue.getI());
		}
		imgui.end();
	}
	gln.GlnKt.glViewport(window.getFramebufferSize());
	gln.GlnKt.glClearColor(new Vec4(.8));
	GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);

	imgui.render();
	window.swapBuffers();
}

When using multiple inputTexts, clicking on one (e.g. 0) immediately copies data to the next array in buf (e.g. 1). It does not touch buf[2]. The text boxes cannot be modified, as the cursor does not stay in them long enough to grab a character. Clicking on the last box (e.g. buf[2]) selects all boxes, copies that value to them, and works to edit text, but for all boxes at one.

Side note: this still happens if buffers are not in a large array, they could be buffer[], james[], and monero[] and this still happens.

Crash on sliders with units

Issue #47 not fixed in commit 0b12a2e

(Widgets > Range WIdgets)
Exception in thread "hmd-renderer" java.lang.NumberFormatException: For input string: "1010 units"
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.base/java.lang.Integer.parseInt(Integer.java:652)
	at java.base/java.lang.Integer.parseInt(Integer.java:770)
	at glm_.ExtensionsKt.getI(extensions.kt:210)
	at imgui.imgui.imgui_internal$Companion.roundScalarWithFormat(internal.kt:3497)
	at imgui.imgui.imgui_main$Companion.dragBehaviorT(main.kt:658)
	at imgui.imgui.imgui_internal$DefaultImpls.dragBehavior(internal.kt:1551)
	at imgui.ImGui.dragBehavior(imgui.kt:45)
	at imgui.imgui.imgui_widgetsDrag$DefaultImpls.dragScalar(widgets drags.kt:266)
	at imgui.ImGui.dragScalar(imgui.kt:45)
	at imgui.imgui.imgui_widgetsDrag$DefaultImpls.dragScalar$default(widgets drags.kt:212)
	at imgui.imgui.imgui_widgetsDrag$DefaultImpls.dragInt(widgets drags.kt:133)
	at imgui.ImGui.dragInt(imgui.kt:45)
	at imgui.imgui.imgui_widgetsDrag$DefaultImpls.dragIntRange2(widgets drags.kt:184)
	at imgui.ImGui.dragIntRange2(imgui.kt:45)
	at imgui.imgui.demo.widgets.invoke(widgets.kt:877)
	at imgui.imgui.demo.ExampleApp.invoke(ExampleApp.kt:180)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:91)
	at imgui.ImGui.showDemoWindow(imgui.kt:45)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:87)
	at imgui.ImGui.showDemoWindow(imgui.kt:45)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.loop(VRScene.java:825)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.lambda$run$0(VRScene.java:263)
	at uno.glfw.GlfwWindow.loop(GlfwWindow.kt:503)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.run(VRScene.java:262)
	at java.base/java.lang.Thread.run(Thread.java:844)

(Widgets > Basics)
Exception in thread "hmd-renderer" java.lang.NumberFormatException: For input string: "44%"
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.base/java.lang.Integer.parseInt(Integer.java:652)
	at java.base/java.lang.Integer.parseInt(Integer.java:770)
	at glm_.ExtensionsKt.getI(extensions.kt:210)
	at imgui.imgui.imgui_internal$Companion.roundScalarWithFormat(internal.kt:3497)
	at imgui.imgui.imgui_main$Companion.dragBehaviorT(main.kt:658)
	at imgui.imgui.imgui_internal$DefaultImpls.dragBehavior(internal.kt:1551)
	at imgui.ImGui.dragBehavior(imgui.kt:45)
	at imgui.imgui.imgui_widgetsDrag$DefaultImpls.dragScalar(widgets drags.kt:266)
	at imgui.ImGui.dragScalar(imgui.kt:45)
	at imgui.imgui.imgui_widgetsDrag$DefaultImpls.dragScalar$default(widgets drags.kt:212)
	at imgui.imgui.imgui_widgetsDrag$DefaultImpls.dragInt(widgets drags.kt:133)
	at imgui.ImGui.dragInt(imgui.kt:45)
	at imgui.imgui.demo.widgets.invoke(widgets.kt:378)
	at imgui.imgui.demo.ExampleApp.invoke(ExampleApp.kt:180)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:91)
	at imgui.ImGui.showDemoWindow(imgui.kt:45)
	at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:87)
	at imgui.ImGui.showDemoWindow(imgui.kt:45)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.loop(VRScene.java:825)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.lambda$run$0(VRScene.java:263)
	at uno.glfw.GlfwWindow.loop(GlfwWindow.kt:503)
	at com.chrjen.pluto.gui.VRScene$VRRenderer.run(VRScene.java:262)
	at java.base/java.lang.Thread.run(Thread.java:844)

So this crashes

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\br3nn\AppData\Local\Temp\lwjglbr3nn\3.1.7-SNAPSHOT\lwjgl.dll: Can't load IA 32-bit .dll on a Intel 64-bit platform
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at org.lwjgl.system.Library.loadSystem(Library.java:162)
at org.lwjgl.system.Library.loadSystem(Library.java:152)
at org.lwjgl.system.Library.loadSystem(Library.java:116)
at org.lwjgl.system.Library.loadSystem(Library.java:67)
at org.lwjgl.system.Library.(Library.java:50)
at org.lwjgl.system.MemoryAccessJNI.(MemoryAccessJNI.java:13)
at org.lwjgl.system.Pointer.(Pointer.java:26)
at org.lwjgl.system.Platform.mapLibraryNameBundled(Platform.java:80)
at org.lwjgl.glfw.GLFW.(GLFW.java:665)
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)
at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:156)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:1088)
at java.lang.reflect.Field.getFieldAccessor(Field.java:1069)
at java.lang.reflect.Field.getInt(Field.java:574)
at org.lwjgl.system.APIUtil.apiClassTokens(APIUtil.java:308)
at uno.glfw.glfw.(glfw.kt:77)
at Poop.(Poop.java:26)
at Poop.main(Poop.java:18)

Max ids

Hi !
I have a problem when I have more than 512 ids used in the same time.
I've got this when I for example draw 2 windows that need to draw a lot of image buttons.

Example :
capture du 2018-01-27 17-17-03

The stacktrace :
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 512
at imgui.internal.Window.getId(classes.kt:560)
at imgui.imgui.imgui_idScopes$DefaultImpls.pushId(id scopes.kt:19)
at imgui.ImGui.pushId(imgui.kt:27)
at imgui.imgui.imgui_widgetsMain$DefaultImpls.imageButton(widgets main.kt:103)
at imgui.ImGui.imageButton(imgui.kt:27)
at imgui.imgui.imgui_widgetsMain$DefaultImpls.imageButton$default(widgets main.kt:96)

Why not use a dynamic list instead of a fixed array?
Thanks, Catvert.

Reduce number of dependencies

Hello,

I'm questioning about how to reduce the size of my build, and now I'm looking about this imgui port. I use it with vulkan, so I have to call getDrawData(), and make the draw myself.

In my context, is that possible to reduce the number of dependencies ? Maybe I don't really need all the LWJGL-3.1.7-SNAPSHOT stuff needed by imgui.

Corrupted cursor graphics

Issue in commit 0b12a2e

Using the built-in cursor by calling io.setMouseDrawCursor(true) now displays a cursor with corrupted graphics.

This did not happen in the previous version I tested, v1.62-beta-02.

cursor-issue

LWJGL Test program fails from jar

Upon running the LWJGL test program from the provided jar, this exception occurs

Exception in thread "main" java.lang.IllegalArgumentException: URI is not hierarchical
at java.io.File.(Unknown Source)
at gln.program.Program.createShader(program.kt:173)
at gln.program.Program.(program.kt:100)
at imgui.impl.LwjglGL3$ProgramA.(LwjglGL3.kt:234)
at imgui.impl.LwjglGL3.createDeviceObjects(LwjglGL3.kt:159)
at imgui.impl.LwjglGL3.newFrame(LwjglGL3.kt:108)
at s.TTest.loop(TTest.java:95)
at s.TTest.run(TTest.java:53)
at s.TTest.main(TTest.java:17)

Still a gradle noob, got the stuff to download but imports not showing up. This came up, looks like a GLN issue, but wasn't sure if it was your implementation or not. Let me know!

Are 1.5 shaders possible ?

Hi,

So my old mac book does not support the current shaders. I get the following error :

Compiler failure in shader.vert shader: ERROR: 0:1: '' : version '330' is not supported
ERROR: 0:9: 'layout' : syntax error: syntax error

This is strange because Apple claims it support OpenGl 3.3. The reported version is "3.3.0 Cocoa NSGL dynamic".

I don't know anything about shaders, but they look sufficiently simple for me to think that it might be possible to convert them to 1.5.

What do you think ?

Regards,

Julien

Multiple font size

Hi !
How can i handle multiple font size ? I tried to load 2 fonts from the same TTF and with a different pixels size but it crash immediatly without any stacktrace but with exit code -1073740940 (0xC0000374).

I used this code to load fonts

var fontBytes = Constants.imguiFontPath.readBytes()
imguiDefaultFont = imgui.IO.fonts.addFontFromMemoryTTF(CharArray(fontBytes.size, { fontBytes[it].c }), 19f, FontConfig(), glyphRanges = imgui.IO.fonts.glyphRangesDefault)
imguiBigFont = imgui.IO.fonts.addFontFromMemoryTTF(CharArray(fontBytes.size, { fontBytes[it].c }),  30f, FontConfig(), glyphRanges = imgui.IO.fonts.glyphRangesDefault)

Is there any solution to have multiple font size with just one font ?
Thanks, Catvert.

Is it possible to use BooleanArray in checkbox ?

I would like to generate a checkbox with enum class:

enum class Enum1 { E1, E2, E3 }
val enum1ArrayEnabled = BooleanArray(Enum1.values().size)

with (imGui) {
  Enum1.values().forEachIndexed { index, value ->
    checkbox(value.name, ::enum1ArrayEnabled[index])
  }
}

::enum1ArrayEnabled[index] does not compile, maybe there is another way to do so...

Regards.

Collapsing window issue

Hello, I have an issue when I collapse a window when i'm using functionalProgramming.window, the window disappeared and is replaced by a debug window.
I have no problem when i'm using begin() with end().

Example :

functionalProgramming.window("Test", null) {
  button("test button")
}

Crash on color picker

When opening color picker and right-mouse clicking into color area to change "color pick mode", the application crashes on

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
	at imgui.imgui.imgui_widgetsColorEditorPicker$DefaultImpls.colorPicker4(widgets colorEditorPicker.kt:334)
	at imgui.ImGui.colorPicker4(imgui.kt:44)
	at imgui.imgui.imgui_widgetsColorEditorPicker$DefaultImpls.colorPicker4$default(widgets colorEditorPicker.kt:299)
	at imgui.imgui.imgui_widgetsText$Companion.colorPickerOptionsPopup(widgets text.kt:266)
	at imgui.imgui.imgui_widgetsColorEditorPicker$DefaultImpls.colorPicker4(widgets colorEditorPicker.kt:313)
	at imgui.ImGui.colorPicker4(imgui.kt:44)
	at imgui.imgui.imgui_widgetsColorEditorPicker$DefaultImpls.colorEdit4(widgets colorEditorPicker.kt:217)
	at imgui.ImGui.colorEdit4(imgui.kt:44)
	at imgui.imgui.imgui_widgetsColorEditorPicker$DefaultImpls.colorEdit4(widgets colorEditorPicker.kt:99)

dragVec3 receiving Vec2 as parameter

Hello,

I'm starting use imgui to test my graphic framework with LWJGL, OpenGL, GLFW...

When I got something working I realized the function dragVec3 seemes to be wrong.

It receiving a Vec2 instead a Vec3.

The Vec3i is correct, I'm using it for now... but I would like ask you to check it.

Thank you.

Going to remove jogamp backend

As titled, I'm planning to remove the jogamp (GL3 and VR) backend in the short future because I won't need it anymore

This will allow to focus my efforts on lwjgl backends and reduce the dependency list and in turn also the build size..

If anyone is still relying/using that, please step in

renderer bug

Hi !
Since last commits (up feb 11-13-18), imgui doesn't render at all (with lwjgl3 at least) ! UI components are present but not displayed.

Image uv

Hi ! I have a little problem, I don't know how to calculate uv0 and uv1 when displaying an image. I've managed to bind a texture with libGDX correctly but I don't understand how uv0 and uv1 work and I think that's why imgui shows me a black image. Thanks to you, Catvert

Max items ?

Hello, I'm trying to add a method to display a list of selectable texture in a window with imageButtons. But when there are more than 125 buttons in the window, buttons (with an index > 125) don't react to the click. I tried to use a withId (index) to make sure they have a different id but it doesn't change anything. Thanks to you, Catvert.
sans titre

kotlin.NotImplementedError: An operation is not implemented.

Hello,

I got a recurring error when I use the colorButton: If I drag and drop (in fact if I move too fast when I click, whatever) it, I will got the following exception:

Exception in thread "main" kotlin.NotImplementedError: An operation is not implemented.
	at imgui.imgui.imgui_dragAndDrop$DefaultImpls.setDragDropPayload(drag & Drop.kt:126)
	at imgui.ImGui.setDragDropPayload(imgui.kt:45)
	at imgui.imgui.imgui_widgetsColorEditorPicker$DefaultImpls.colorButton(widgets colorEditorPicker.kt:646)
	at imgui.ImGui.colorButton(imgui.kt:45)
	at org.sheepy.vulkan.sand.graphics.SandUIDescriptor.newFrame(SandUIDescriptor.java:110)
	at org.sheepy.vulkan.imgui.ImGuiPipeline.newFrame(ImGuiPipeline.java:377)
	at org.sheepy.vulkan.sand.pipelinepool.RenderPipelinePool.execute(RenderPipelinePool.java:74)
	at org.sheepy.vulkan.sand.SandApplication.drawFrame(SandApplication.java:169)
	at org.sheepy.vulkan.VulkanApplication.mainLoop(VulkanApplication.java:125)
	at org.sheepy.vulkan.sand.SandApplication.mainLoop(SandApplication.java:128)
	at org.sheepy.vulkan.VulkanApplication.run(VulkanApplication.java:63)
	at org.sheepy.vulkan.sand.SandApplication.main(SandApplication.java:178)

Not a big problem, I just open an issue to track it.

I use the last Snapshot "v1.62-beta-02".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.