Exemple #1
0
    public void Render()
    {
        if (_frameBegun)
        {
            _frameBegun = false;
            ImGui.Render();
            //#TODO : Pass GetDrawData to the C++ dll.
            var d = ImGui.GetDrawData();

            ImGuiPluginHook.SendImGuiDrawCommands(d);
        }
    }
Exemple #2
0
    public void RecreateFontDeviceTexture(bool sendToGPU)
    {
        ImGuiIOPtr io = ImGui.GetIO();
        IntPtr     pixels;
        int        width, height, bytesPerPixel;

        io.Fonts.GetTexDataAsRGBA32(out pixels, out width, out height, out bytesPerPixel);

        if (sendToGPU)
        {
            IntPtr fontTexID = ImGuiPluginHook.GenerateImGuiFontTexture(pixels, width, height, bytesPerPixel);
            io.Fonts.SetTexID(fontTexID);
        }

        io.Fonts.ClearTexData();
    }