Comments (14)
I use KTX in my project, you can check out if you want : https://github.com/Catvert/Platform-Creator
Have a look at this project too : https://github.com/Catvert/Imgui-test, its a simple example with LibGDX but without kTX but you can adapt the code easily.
from imgui.
I found the problem, nothing is drawn unless I call:
if (ImGui.drawData != null) LwjglGL3.renderDrawData(ImGui.drawData!!)
However, I have a JavaVM crash after 10s, it occurs even if I call only LwjglGL3.newFrame()
crash log (hs_err_pid4212.log): https://pastebin.com/cV5hKTbR
the interesting part of the log seems to be:
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) J 1075 org.lwjgl.system.JNI.invokePPPV(JJJJ)V (0 bytes) @ 0x0000000004e83f4e [0x0000000004e83f00+0x4e] J 1295 C1 uno.glfw.GlfwWindow.getFramebufferSize()Lglm_/vec2/Vec2i; (111 bytes) @ 0x00000000050c4d04 [0x00000000050c4340+0x9c4] J 1465 C1 imgui.impl.LwjglGL3.newFrame()V (1106 bytes) @ 0x000000000518a6c4 [0x0000000005186480+0x4244] J 1545 C1 com.datoh.lifekt.desktop.Game.render(F)V (50 bytes) @ 0x0000000005272dc4 [0x0000000005272b40+0x284] J 1488 C1 ktx.app.KtxGame.render()V (65 bytes) @ 0x00000000051aad7c [0x00000000051aaa00+0x37c] J 1422 C1 com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update()Z (213 bytes) @ 0x0000000005128ddc [0x0000000005127d80+0x105c] j com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop()V+101 j com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lcom/badlogic/gdx/ApplicationListener;Lcom/badlogic/gdx/backends/lwjgl3/Lwjgl3ApplicationConfiguration;)V+257 j com.datoh.lifekt.desktop.KtxSampleAppKt.main([Ljava/lang/String;)V+67 v ~StubRoutines::call_stub
from imgui.
Yes, a short explanation is here here (but I'll add it in the wiki)
This is the appBuffer
object.
It's thread-safe and fast because you pay only a single allocation overhead at begin of your app and then one clear per frame. From there any "allocation" is just dummy, that is a call to intAtomic
Basically it's suitable for any short-live native allocations, included OpenGL and Vulkan native resources, as well as GLFW. Plus anything else the user may ever need
It gets automatically called if you use the window.loop { }
, otherwise you have to do it manually
Ps: you should also call it in the reshape, because if the user start resizing the window dragging for a time long enough he will fill it up
from imgui.
Thanks a lot for the support !
from imgui.
Hi!
unfortunately that is not possible. It'd be cool, but there seems to be no way at the moment.
But we can simply pass the array itself with an index.
checkbox(value.name, enum1ArrayEnabled, index)
I just pushed, give it a look
from imgui.
I used imgui-kotlin 1.53 and lwjgl 3.1.5
I moved to imgui-kotlin master and lwjgl 3.1.7
But now, I have the following error at run : Caused by: java.lang.Error: No current context. Did you call ImGui::Context() or ImGui::setCurrentContext()?
I add a context creation but imGui is not displayed anymore:
class Application : KtxGame<Screen>() {
private val context = Context()
private var contextImGui: imgui.Context? = null
override fun create() {
val window = GlfwWindow((Gdx.graphics as Lwjgl3Graphics).window.windowHandle)
contextImGui = imgui.Context()
LwjglGL3.init(window, false)
context.register {
bindSingleton<Viewport>(ScreenViewport())
bindSingleton<Batch>(SpriteBatch())
bindSingleton(Stage(inject(), inject()))
bindSingleton(this@Application)
bindSingleton(Game(inject(), inject()))
}
addScreen(context.inject<Game>())
setScreen<Game>()
}
override fun dispose() {
contextImGui?.destroy()
LwjglGL3.shutdown()
super.dispose()
}
}
In more had a compilation error that I remove for now (imgui.IO.wantCaptureMouse is not anymore recognized)
from imgui.
That Error is thrown whenever gImGui
is still null
when you want to use imgui to render some gui
Theoretically, after you instantiate the imgui.Context()
, gImGui
shouldn't be null anymore. Check that
wantCaptureMouse
is there, I have no idea why you can't see it
from imgui.
gImGui is initilialized.
Do you know why the imGui window is not displayed?
from imgui.
It's very hard to know why without having access to some code.
What I can suggest you, is to start from the tests and then build it up from there
from imgui.
I understand but I really would like to use Ktx...
Here is my build.gradle and standalone file sample app (maybe it would be nice to add it as test app):
build.gradle: https://pastebin.com/rfDtvZPQ
KtxSampleApp.kt: https://pastebin.com/NJAH1Gpt
from imgui.
@Catvert I have the same crash on your project https://github.com/Catvert/Platform-Creator
I don't have it on Imgui-test
I use JDK 1.8
from imgui.
Try add appBuffer.reset()
in your loop
I'll expand the wiki soon about that
from imgui.
It works !
But it is a good practice to reset the buffer each frame?
from imgui.
I'll close it, if it's fine for you
from imgui.
Related Issues (20)
- Example Log doesn't display any text unless a filter is applied HOT 1
- is jdk8-snapshot doesnt work anymore? HOT 1
- Shaders do not compile on M1 (macOS 11.4) HOT 3
- Methods need unecessary parameters when used in java HOT 3
- Some clear, modern example would help
- Unable to load ForwardDeclarationsKt when using Java modules HOT 2
- Use of `static` in package identifier can cause Java interoperability problems HOT 1
- MainMenuBar causes NullPointerException when clicking on free space HOT 1
- `listbox` shows no items
- ImGui can't access static fields and members of org.lwjgl.stb.STBRPRect HOT 3
- Invalid Package name HOT 3
- Index 33619455 out of bounds for length 0 HOT 1
- Documentation still references dl.bintray.com (shutdown nearly two years ago) HOT 1
- Is there a version of imgui for kotlin that works with lwjgl 3.3.1 HOT 7
- Cant get VertexBuffer data from DrawList class HOT 27
- Update Wiki HOT 1
- java.lang.NoClassDefFoundError: uno/glfw/HWND HOT 4
- Rendering artifacts on non-square elements HOT 1
- useBufferSubData breaks rendering completely, if set to true
- NoClassDefFoundError: uno/glfw/HWND HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imgui.