Skip to content
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

Can the Image.cpp load models ? #32

Open
linuxing3 opened this issue Dec 5, 2022 · 3 comments
Open

Can the Image.cpp load models ? #32

linuxing3 opened this issue Dec 5, 2022 · 3 comments

Comments

@linuxing3
Copy link

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
Copy link

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
Copy link
Author

linuxing3 commented Jul 29, 2023

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
Copy link

thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants