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

Load image with Vulkan #1764

Closed
L4zyy opened this issue Apr 21, 2018 · 2 comments
Closed

Load image with Vulkan #1764

L4zyy opened this issue Apr 21, 2018 · 2 comments

Comments

@L4zyy
Copy link

L4zyy commented Apr 21, 2018

Version/Branch of Dear ImGui: v1.60 WIP

I'm trying to load an icon image with stb_image lib to make a imageButton, but I don't know what to pass to the creation function as texture_id parameter.

I try to use the raw image data returned by stbi_load function but failed, I try to use VkImage, VkImageView and VkDeviceMemory data but all failed.

The original image will be like this:
image

The result I got is:
image

I've read the demo file but I still don't understand what to pass.

I've read the imgui_impl_glfw_vulkan file but I got
"// Missing features:
// [ ] User texture binding. Changes of ImTextureID aren't supported by this binding! See #914
"

I'm sorry that i am new to both vulkan and imgui, I would appreciate that if anyone can help me.

@ocornut
Copy link
Owner

ocornut commented Apr 22, 2018

The result I got is:

This is the imgui font atlas scaled down.

As noted in the comment you noticed under "Missing features", the Vulkan binding doesn't currently support changing textures in the rendering loop so everything is drawn using the imgui font atlas.

It's actually a very rather change, but we couldn't agree on which way/type to use and this issue has been stalled forever because of that.

See #914 for the discussion, you may merge the commit/branch from #914 to get the feature (which uses VkDescriptorSet here), or use whatever type makes more sense in your code base.

@L4zyy L4zyy closed this as completed Apr 22, 2018
@L4zyy
Copy link
Author

L4zyy commented Apr 22, 2018

Thanks for helping ^ ^

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

No branches or pull requests

2 participants