VesCodes / ImGui

ImGui plugin for Unreal Engine
MIT License
107 stars 15 forks source link

How to render images? #3

Closed Wyverex42 closed 8 months ago

Wyverex42 commented 8 months ago

Hi,

thanks for this library, it works so much better than another library we were using beforehand!

I'm currently trying to render an image with ImGui. I found one example within the plugin itself where the font atlas is built and then the pointer to the UTexture2D is passed as an ImTextureID.

So I tried just passing a pointer to a UTexture2D (which is set as a default property on another class) to ImGui::Image but nothing is rendered. I also couldn't find where the conversion between ImTextureID and the actual draw commands is taking place so I can't say why it's not working.

Should this be supported?

Wyverex42 commented 8 months ago

Ah nvm, it works with other textures! There's something wrong with the particular texture I'm trying to use

VesCodes commented 8 months ago

Heya!

You should be able to just pass a UTexture2D pointer to ImGui::Image, for example:

ImGui::Image(GEngine->DefaultTexture, FVector2f(512, 512));

image