/// <summary> /// Cleans up any created resources and stops the render loop. /// </summary> public override void Teardown() { Stop(); //_polarCamView.Close(); if (filename != "") { _flyCamView.Close(); } XnaRenderer.Instance.Views.Clear(); }
private void InitializeUi() { //Create ImGui Windows var mainmenu = new UIMainMenuBar(new IUIComponent[] { new UIMenu("File", new IUIComponent[] { new UIMenuItem("Open Scene", "CTRL+O"), new UIMenuItem("Open Project", "CTRL+SHIFT+O"), new UIMenuItem("New Scene", "CTRL+N"), new UIMenuItem("New Project", "CTRL+SHIFT+N"), new UIMenuItem("Exit", "ALT+F4", () => view.Close()) }), new UIMenu("Edit", new IUIComponent[] { new UIMenuItem("Open Scene", "CTRL+O"), new UIMenuItem("Open Project", "CTRL+SHIFT+O"), new UIMenuItem("New Scene", "CTRL+N"), new UIMenuItem("New Project", "CTRL+SHIFT+N"), new UIMenuItem("Exit", "ALT+F4", () => view.Close()) }), new UIMenu("Windows", new IUIComponent[] { new UIMenuItem("Scene", action: () => uihost.Children.Add(new UIWindow("Scene", new IUIComponent[] { }))) }) }); var sceneWindow = new UIWindow("Scene", new IUIComponent[] { }); var gameWindow = new UIWindow("Game", new IUIComponent[] { new UIMenuBar(new IUIComponent[] { new UIMenu("Status", new IUIComponent[] { new UIMenuItem($"FPS: {ImGui.GetIO().Framerate}") }), }), }); var hierarchyWindow = new UIWindow("Hierarchy", new IUIComponent[] { }); var inspectorWindow = new UIWindow("Inspector", new IUIComponent[] { }); var projectWindow = new UIWindow("Project", new IUIComponent[] { }); var consoleWindow = new UIWindow("Console", new IUIComponent[] { }); var pattern = new MIDIPattern(); projectConnect = new ProjectConnect(); var pianoRollWindow = UIUtils.CreatePianoRollWindow(projectConnect, pattern, gd, imGui); // Initialize imgui UI uihost = disposer.Add(new UIHost(new IUIComponent[] { mainmenu, sceneWindow, gameWindow, hierarchyWindow, inspectorWindow, projectWindow, consoleWindow, //pianoRollWindow, })); frameTimer = new Stopwatch(); frameTimer.Start(); hotkeys = new HotkeyHandler <GlobalHotkey>(); }