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
ImGui::Image example DX9 ? #510
Comments
Everything should be documented if you read the comment about TextureId, the code in direct9_example/ and the "Image" example in the imgui demo. Basically ImTextureId is a void* where you can store anything you want. Whatever you pass to Image() is passed down the pipeline to your render function in the end, which can change texture according to this void*. |
That is what confused me, the "Image" example in the imgui demo was using the Textureid from the FontAtlas. And in the header was something written with "SetTextID(..)" , but that just set the current TextureID of the fontatlas instance....which afaik is not meant for drawing nor handling other images ? |
It is doing that because that's the only texture that the demo application has access to. |
Yes I read these comments, but I fail to make it "use" my texture for that, I guess because I fail to see the connection between my custom texture, FontAtlas's SetTextID and how imgui's drawing works. That's why I asked for a tiny code example, since I lack some important part I assume ^^ |
Somewhere in the ImGui_ImplDX9_RenderDrawLists, // Render command lists I assume it will be passing back my Texture ID and I have to handle the rendering for that texture ? |
The code in imgui_impl_dx9.* assume that ImTextureId == LPDIRECT3DTEXTURE9 |
Hmm, from all I know, I did that in my code, I used the pointer to the texture as TextureId, passing it as void_: |
I don't know what pTexture is, it is a Thanks! Sorry I can't help a lot those questions are overwhelming and I'm trying to shut them down as fast as I can :) |
Not really an issue, but rather a noob question.
Does anyone have a tiny example how I can load and use my own textures in dx9 with imgui:image ?
I'm not very experienced in dx drawing stuff and only managed to get a white empty rectangle showing up in imgui..so I guess I'm missing something.
In my Init func, I'm loading the texture from the file into memory:
static LPDIRECT3DTEXTURE9 pTexture= NULL;
D3DXCreateTextureFromFile(g_pD3DDevice, "something.jpg", &pTexture)
...
now I guess I'm missing something here ?
...
and later calling the ImGui:Image((void*)pTexture, .... ) to add the image to my window.
I guess I'm missing the part where the texture gets loaded into the renderpipeline, but I'm not so sure where to do this... ImGui:Image adds the required vertices to it's own buffer from what I saw, but somewhere a direct3DDevice->SetTexture (0, texture); is missing I guess ?
Thanks for a quick slap on my head ;)
(does anyone have experience with loading quite a few textures (let's say 50 icons or so) + running imgui in terms of FPS ?)
The text was updated successfully, but these errors were encountered: