Skip to content

How to recover the raw data of the ImDrawCmd.Texture? #263

@giron3s

Description

@giron3s

I would like to integrate the ImGui.Net into the costume engine based on SlimDX(Directx 9)

In the last few days, I almost integrated, but only missing to solve one single problem. When I render ImGui surfaces and obtain ImDrawCmd, instead of the ImDrawCmd.TextureId needs to obtain the raw texture(byte[] rawtex) to able to reconstruct and draw with SlimDX.
I can not find any way that ImGUI return the array of bytes from one texture ID :( Exist any way to get the texture in a byte from the ImDrawCmd? Exists to get raw texture(byte[]) from ImGUI??

Current status of the code
` ImGui.Render();
ImDrawDataPtr draw_data = ImGui.GetDrawData();

        var vertex_offset = 0;
        var index_offset = 0;
        for (var i = 0; i < draw_data.CmdListsCount; ++i)
        {
            var command_list = draw_data.CmdListsRange[i];
            for (var command_index = 0; command_index < command_list.CmdBuffer.Size; ++command_index)
            {
                var draw_command = command_list.CmdBuffer[command_index];

                {
                    DrawPrimitives(vertex_offset, index_offset, command_list, draw_command);
                }
        
                index_offset += (int)draw_command.ElemCount;
            }
        
            vertex_offset += command_list.VtxBuffer.Size;
        }
    }`

Current screenshoot
ImGUI_Issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions