Created
July 14, 2022 09:19
-
-
Save DubThink/5b2666776ae587ea0d8ae46c6ca72972 to your computer and use it in GitHub Desktop.
Repros Monogame.Imgui.Renderer crash from imgui generating empty draw commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Xna.Framework; | |
using Microsoft.Xna.Framework.Graphics; | |
using Monogame.Imgui.Renderer; | |
using ImGuiNET; | |
public class TestImguiCrash : Game | |
{ | |
private GraphicsDeviceManager _graphics; | |
private ImGuiRenderer _imGUIRenderer; | |
public TestImguiCrash() | |
{ | |
_graphics = new GraphicsDeviceManager(this); | |
IsMouseVisible = true; | |
Window.AllowUserResizing = true; | |
} | |
protected override void Initialize() | |
{ | |
_imGUIRenderer = new ImGuiRenderer(this); | |
_imGUIRenderer.RebuildFontAtlas(); | |
} | |
protected override void Draw(GameTime gameTime) | |
{ | |
_graphics.GraphicsDevice.Clear(Color.Coral); | |
_imGUIRenderer.BeforeLayout(gameTime); | |
ImGui.ShowDemoWindow(); | |
_imGUIRenderer.AfterLayout(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment