StudioCherno / Walnut

Walnut is a simple application framework for Vulkan and Dear ImGui apps
MIT License
1.99k stars 367 forks source link

Can the Image.cpp load models ? #32

Open linuxing3 opened 1 year ago

linuxing3 commented 1 year ago

Walnut is awesome. The Image.h and Image.cpp simplify a lot rendering images. Is the any sample code about how to use walnut to load models and textures? Thanks!

erdem0818 commented 1 year ago

This may be unrelated, but can I ask for some guidance on how to load and render image files in Walnut? I have been struggling with it and could use some help.

linuxing3 commented 1 year ago

To my understanding you may just use Imgui::Image("image.png", {witdth, height}) to load and show image in a imgui window.

If you prefer to use Image.cpp to load image data in Gpu, just do this in your renderer.cpp:

auto img = Image("image.png");

and in imgui window:

ImGui::Image(m_Image->GetDescriptorSet(), { (float)m_Image->GetWidth(), (float)m_Image->GetHeight() });

erdem0818 commented 1 year ago

thanks a lot