lwjglgamedev / vulkanbook

Online book which introduces the main concepts required to write graphics games or any other applications using Vulkan in Java by using the LWJGL library.
MIT License
251 stars 13 forks source link

(Post-Tutorial Question) Drawing an image with ImGUI. #92

Open Wertuu opened 1 month ago

Wertuu commented 1 month ago

Howdy, It's been a little while since I finished this tutorial, and I was just wondering if you tried to draw an image into an ImGUI frame? I ran into some issues myself and I was just unsure if I was doing it wrong. In online forums, people have said that it's because it's designed for OpenGL when using LWJGL.

So I guess the question if you do run into ths is: would you recommend an alternative library or doing it without a libray?

lwjglgamedev commented 1 month ago

Hi, it should be possible to do that. I do not understand why they mention OpenGL. In any case, I will try to check an example to see how it can be done, You are trying to display a texture?

Another alternative should be nuklear, which, if I recall corectly, LWJGL has bindings for it.

Wertuu commented 1 month ago

Yes, specifically displaying a Vulkan texture into an ImGui frame. This is a related bug ticket link.

lwjglgamedev commented 1 week ago

Ok. This seems to be solved here. Now you can use longs as texture ids and use the descriptor set associated to the texture. Let's wait for a new release of imgui to be published.

In any case, I will leave this issue open to include a specific example. This will be done in the new version of the book, which uses Vulkan latest features (still in progress). Right now the GUI render class does not care about texture ids (and it should)