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

Create Texture for ImGui::Image (DirectX 11) #1979

Closed
MrArting opened this issue Jul 29, 2018 · 3 comments
Closed

Create Texture for ImGui::Image (DirectX 11) #1979

MrArting opened this issue Jul 29, 2018 · 3 comments
Labels

Comments

@MrArting
Copy link

Hello. I want to ask how to create texture for ImGui::Image properly in DirectX 11 from PNG file?
In DirectX 9 I using D3DXCreateTextureFromFileInMemoryEx, and all is fine:
dota2_2018-07-29_16-57-40

In DirectX 11 I tryed to use D3DX11CreateShaderResourceViewFromMemory, but something wrong with colors (too much white):
dota2_2018-07-29_16-53-52

How can I fix this problem?

@ocornut
Copy link
Owner

ocornut commented Jul 29, 2018

ImGui::Image() create vertices that are rendered by the example binding imgui_impl_dx11.cpp, there's no processing or modification or magic performed by dear imgui, it doesn't even know anything about your textures, it's just passing data around.

This is probably a sRGB vs Linear Space issue with your setup, see #1927.

@ocornut ocornut closed this as completed Jul 29, 2018
@ocornut
Copy link
Owner

ocornut commented Sep 22, 2020

(Adding ref in some old issues for searching purpose)

There’s a tutorial to load textures with various graphics api here: https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples

@yaroslavhorokhovets
Copy link

@ MrArting , Nice to meet you. Excuse me, could you send me your source code used DirectX9? So, I can solve your issue perfectly.

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

No branches or pull requests

3 participants