-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Imgui on Android question #1200
Comments
You're drawing over your ImGui windows. Try moving your ImGui::Render() call after you're done rendering your graphics. Not sure if that's related, but in your vertex shader you're expecting a vec4, but you actually try to pass vec2s. |
Have you tried changing your Most of the docs are in the source and header files themselves, here's a short programming guide: https://github.com/ocornut/imgui/blob/master/imgui.cpp#L79 |
Yeah, I've changed vertex shader, just forgot to write about it in previous comment
|
Shouldn't it read
? You probably don't want your |
Upon closer inspection, it seems like imgui_impl_android is adapted from opengl3 example, with any mention of VAOs removed (as they are not part of es2 spec). This probably means you want to move all of the |
Hahahaha! Thanks! Fixed code: Thanks a lot! |
It would be good if the android example had an official maintainer to make them nice and simple and synched to the other examples!
|
@ocornut I'd say an OpenGL ES2 implementation (preferably with SDL2, since it seems to be the most cross-platform solution) should be sufficient. Creating a full Android Studio project isn't hard, but it seems like everyone and their cat has their own unique workflow, with build systems ranging from shell scripts and makefiles to cmake + standalone toolchains to "official" gradle support. I've converted a project from ant+ndk-build to gradle+invoking ndk-build through a cmd to gradle-experimental to gradle+cmake over a span of two years, and while I now have some cutting-edge technology like a resource-hungry IDE with C++ syntax highlighting and almost working debugging, I'm not sure google won't think of moving to yet another build system next week. |
It could help someone if you want to build a simple project with SDL2, ndk-build and ant : I've been able to build it and put it on my zenfone2 this afternoon without issue. |
@sfalexrog I'd take the Android example solution that is the most standard while not taking too much disk space on Git if possible (avoid unnecessary large files such as large icons). I don't have an Android device and would be happy if an official, simple, example was made available (with support for things like text input using the |
Closing this,
|
Hi!
I am currently trying to run imgui on android via ndk/jni.
So I found this
But I don't want to use SDL2, I want to just use Android's GLSurfaceView and GLSurfaceView.Renderer and then pass native methods for opengl rendering (I have to admit that I've downloaded this imgui+sdl2+android demo from google store and it works great on my device).
So I've built my own demo using GLSurfaceView and it works only if I don't mix it with my own opengl ;/
I added a .zip with all the demo. You can build it with:
ndk-build
ant-debug
adb install -r bin/ImguiExample-debug.apk
This is my rendering loop callback:
I use imgui implementation provided with android example I've linked, with slight changes (I dont use SDL2 and I commented out all events related code for now).
For me it looks like opengl state wasn't handled properly (glVertexAttribPointer call is messing it somehow). Do you have any idea what may be the problem?
The text was updated successfully, but these errors were encountered: