Comments (10)
Yeah, of course. Just thought it was possible to use openGl along with Vulkan specifically to render image in ImGui. Well, maybe it sounds silly, sorry, this is too new for me.
Original C++ function ImGui::Image(..) wants an 32bit integer type if we are using OpenGL. Because glGenTextures outputs an unsigned int.
But the same functions wants an 64bit integer type if we are using Vulkan. Address of the VkDescriptorSet.
But we can't pass 64bit integer (long) in this repo, so we can't display images using Vulkan.
from imgui-java.
Thank you! I will try to follow your steps but if it doesn't work it'd be usefull to have working files. Why C? :) Have you encountered more problems with everything ported to Java?
My vulkan-image-display-working set of files :)
https://drive.google.com/file/d/1-ispK2iK3NHiacRQvPVmkahNcufqFrZN/view?usp=sharing
As for C vs Java;
Mainly the project output/release size.
Java project, with all those lwjgl jar files, after proguard, jlink, jpackage, release directory is 125mb for linux. It is big because it contains a subset of jdk, jlink does that. And dynamic libraries that are in lwjgl jar files (.so and .dll files).
Same project using C, output is 6.5mb :) Using 13 libraries all statically linked.
When we use statically linked libraries in c or c++ only used portion of libraries included in the final executable.
But if we use dynamic libraries the whole .so or .dll files needs to reside beside the executable.
I also kind of like manual memory management, no more garbage collection for me :)
C apps start very fast.
And even tho java has JIT compiler that makes the application run as fast as native applications I could not see the same performance in my project.
Although this is a simple scene, i tested with busy scenes as well. These stats were always slower on Java.
from imgui-java.
@enesaltinkaya, did you find a solution?
Maybe you have a code snippet to use openGl here to display images while it's still an issue?
from imgui-java.
I downloaded the repo, changed these to accept long;
public static native void image(long textureID, float sizeX, float sizeY); /*
ImGui::Image((ImTextureID)(intptr_t)textureID, ImVec2(sizeX, sizeY));
*/
public static native void image(long textureID, float sizeX, float sizeY, float uv0X, float uv0Y); /*
ImGui::Image((ImTextureID)(intptr_t)textureID, ImVec2(sizeX, sizeY), ImVec2(uv0X, uv0Y));
*/
public static native void image(long textureID, float sizeX, float sizeY, float uv0X, float uv0Y, float uv1X, float uv1Y); /*
ImGui::Image((ImTextureID)(intptr_t)textureID, ImVec2(sizeX, sizeY), ImVec2(uv0X, uv0Y), ImVec2(uv1X, uv1Y));
*/
public static native void image(long textureID, float sizeX, float sizeY, float uv0X, float uv0Y, float uv1X, float uv1Y, float tintColorR, float tintColorG, float tintColorB, float tintColorA); /*
ImGui::Image((ImTextureID)(intptr_t)textureID, ImVec2(sizeX, sizeY), ImVec2(uv0X, uv0Y), ImVec2(uv1X, uv1Y), ImVec4(tintColorR, tintColorG, tintColorB, tintColorA));
*/
public static native void image(long textureID, float sizeX, float sizeY, float uv0X, float uv0Y, float uv1X, float uv1Y, float tintColorR, float tintColorG, float tintColorB, float tintColorA, float borderR, float borderG, float borderB, float borderA); /*
ImGui::Image((ImTextureID)(intptr_t)textureID, ImVec2(sizeX, sizeY), ImVec2(uv0X, uv0Y), ImVec2(uv1X, uv1Y), ImVec4(tintColorR, tintColorG, tintColorB, tintColorA), ImVec4(borderR, borderG, borderB, borderA));
*/
Then i searched for corresponding calls (ImGui::Image((ImTextureID)... calls) in .cpp or .c files in the project, changed those too to accept 64bit ints.
Compiled these two, imgui-java64.dll, libimgui-java64.so.
And it worked.
But then i dropped java altogether and went back to C. :)
I have those dll and so files, and java files if you want them.
from imgui-java.
@enesaltinkaya, did you find a solution? Maybe you have a code snippet to use openGl here to display images while it's still an issue?
Displaying OpenGL textures using ImGui.image(...) should work without any issues.
This issue is about displaying them using Vulkan.
from imgui-java.
I have those dll and so files, and java files if you want them.
Thank you! I will try to follow your steps but if it doesn't work it'd be usefull to have working files.
Why C? :) Have you encountered more problems with everything ported to Java?
from imgui-java.
This issue is about displaying them using Vulkan.
Yeah, of course. Just thought it was possible to use openGl along with Vulkan specifically to render image in ImGui. Well, maybe it sounds silly, sorry, this is too new for me.
from imgui-java.
@enesaltinkaya, thank you. I've been trying to render an image in ImGui with Vulkan for 3 days btw
from imgui-java.
If it still wont work you can add me on Discord, username is gnu4493.
from imgui-java.
If it still wont work you can add me on Discord, username is gnu4493.
ok, I sent a request
from imgui-java.
Related Issues (20)
- Bug: ImPlot#dragPoint binding is wrong implemented
- Bug: every launch copies the binary DLL into Windows Temp dir
- Binding wrong type: PlotShaded yref parameter should be double
- Bug: setFullScreen does not work HOT 1
- Mobile Support
- Update ImNodes to latest version
- Unable to assign / use custom ImGuiStyle HOT 1
- Bug: Maven fat jar not working on windows HOT 1
- Calls to getCmdListVtxBufferData() and getCmdListIdxBufferData() overwrite eachother HOT 8
- Bug: Clone Issue
- Bug: OpenGL Rendering in Imgui HOT 2
- Bug: crash when debugging with JDK 21 HOT 1
- [Question] Is it supports lwjgl legacy? (2.7.3) HOT 2
- Bug: ImGuiInputTextCallbackData#insertChars handles UTF-8 characters incorrectly
- Git Clone HOT 1
- Bug: ImGui is setting the font texture ID to zero everytime the font atlas is built. HOT 1
- Bug: imgui UI is missing in the Gizmo example HOT 1
- Porting of ShowDemo_RealtimePlots over Java
- Missing Bindings: ImGui::ImageButton(ImGuiID id, ImTextureID texture_id, ...etc) 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-java.