private static void RenderException(RenderableException exception) { string exceptionTitle = exception.Title; string exceptionSummary = exception.ExceptionSummary; if (!ImGui.IsPopupOpen(exceptionTitle)) { ImGui.OpenPopup(exceptionTitle); } if (ImGui.IsPopupOpen(exceptionTitle)) { Vector2 textInputSize = SetExceptionScreenPositionAndSize(); if (ImGui.BeginPopupModal(exceptionTitle, ref _isRenderingTopException, ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.AlwaysAutoResize)) { bool escapePressed = ImGui.IsKeyPressed(ImGui.GetKeyIndex(ImGuiKey.Escape)); ImGui.InputTextMultiline("TextInput", ref exceptionSummary, 1024, textInputSize, ImGuiInputTextFlags.ReadOnly); ImGui.EndPopup(); if (escapePressed) { _isRenderingTopException = false; } } } }
public static void PushExceptionForRendering(string title, Exception exception) { var newException = new RenderableException(title, exception); PushExceptionForRendering(newException); }
public static void PushExceptionForRendering(RenderableException exception) { _isRenderingTopException = true; _currentException = exception; }