ImGuiNET / ImGui.NET

An ImGui wrapper for .NET.
MIT License
1.8k stars 298 forks source link

Cannot render any texture (including the Font texture) in my window using ImGui.Image #444

Open SkyLeite opened 7 months ago

SkyLeite commented 7 months ago

Hello!

I've been using ImGuiNET for my project and it seems to work perfectly, except for when I attempt to show any kind of image. My code is a complete mess since I'm still experimenting, but the following piece of code produces the window attached after it

var foo = true;
if (ImGui.Begin("Font", ref foo, 0))
{
    var io = ImGui.GetIO();
    if (io != null)
    {
        var texID = io.Fonts.TexID;
        var texW = io.Fonts.TexWidth;
        var texH = io.Fonts.TexHeight;

        ImGui.Text("FontTex");
        igNET.ImGui.Image(texID, new Vector2(texW, texH), new Vector2(0.0f, 0.0f), new Vector2(1.0f, 1.0f), new Vector4(1.0f, 1.0f, 1.0f, 1.0f));
    }
}

image

I assumed this was an issue with my rendering pipeline, but as you can see in the following screenshot, the Dear ImGui debugger (which is called from the same function as the previous snippet) has no problem rendering it.

image

What could be causing this issue? Is there any more information I can provide that could help narrow the issue down?

Thanks in advance