Hi,
Sorry for some beginner questions.
Can you provide any short examples for loading a image in IMGUI?
i.e. .... img = ... loadimage('.....');
texture = /////
tex_id = ...
ImGui::Image(tex_id,....)
What type is ImTextureID, is it possible to get from a gl::Texture2dRef or ?
Thanks!
imgui isn't an image library. It is up to you to have the raw texture data
already uploaded to the GPU and ready to use for imgui to reference. You
should find another library or write your own code to get texture data into
memory and upload to DirectX or OpenGL.
The imgui.h header has type of ImTextureID, which is void *. It's simply a
type agnostic way of passing around texture references until it hits your
renderer to use. Type cast it to the type you expect for the rendering
backend that you have.
On Wed, Mar 23, 2016 at 9:46 PM, Stream [email protected] wrote:
Hi,
Sorry for some beginner questions.
Can you provide any short examples for loading a image in IMGUI?i.e. .... img = ... loadimage('.....');
texture = /////
tex_id = ...
ImGui::Image(tex_id,....)What type is ImTextureID, is it possible to get from a gl::Texture2dRef or
?Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
https://github.com/ocornut/imgui/issues/562
Also see
https://github.com/ocornut/imgui/issues/561
https://github.com/ocornut/imgui/issues/521
https://github.com/ocornut/imgui/issues/510
https://github.com/ocornut/imgui/issues/497
https://github.com/ocornut/imgui/issues/475
This is a commonly asked question so I am going to try clarifying this in the docs and FAQ.
could you give me a example for loading image in Imgui?
I have now written a tutorial to cover image file loading for common graphics API:
https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples
Most helpful comment
could you give me a example for loading image in Imgui?