Beispiel #1
0
        /// <summary>
        /// Closes the pipe and the MasterRenderer.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnClosing(CancelEventArgs e)
        {
            IsClosing = true;

            MasterRenderer.Dispose();
            controller.Dispose();
        }
Beispiel #2
0
 public void cleanup()
 {
     _gd.WaitForIdle();
     _controller.Dispose();
     _cl.Dispose();
     _gd.Dispose();
 }
Beispiel #3
0
 /// <inheritdoc />
 protected override void OnClosed()
 {
     Test?.Dispose();
     Test = null;
     Global.DebugDraw.Destroy();
     Global.Settings.Save();
     _controller.Dispose();
     _controller = null;
     _stopwatch.Stop();
     base.OnClosed();
 }
Beispiel #4
0
        protected virtual void Dispose(bool disposing)
        {
            if (!_disposedValue)
            {
                if (disposing)
                {
                    _imGuiController.Dispose();
                }

                _disposedValue = true;
            }
        }
Beispiel #5
0
        private void Cleanup()
        {
            if (Updates.PendingInstallPath != null && System.IO.File.Exists(Updates.PendingInstallPath))
            {
                Updates.PerformFileSwap(Updates.PendingInstallPath);
            }


            Exit();

            // Clean up Veldrid resources
            _gd?.WaitForIdle();
            _controller?.Dispose();
        }
Beispiel #6
0
        static void Main(string[] args)
        {
            // Create window, GraphicsDevice, and all resources necessary for the demo.
            //VeldridStartup.CreateWindowAndGraphicsDevice(
            VeldridStartup.CreateWindowAndGraphicsDevice(
                new WindowCreateInfo(50, 50, 1280, 720, WindowState.Normal, "ImGui.NET Sample Program"),
                new GraphicsDeviceOptions(true, null, true),
                GraphicsBackend.OpenGL,
                out _window,
                out _gd);
            _window.Resized += () =>
            {
                _gd.MainSwapchain.Resize((uint)_window.Width, (uint)_window.Height);
                _controller.WindowResized(_window.Width, _window.Height);
            };
            _cl         = _gd.ResourceFactory.CreateCommandList();
            _controller = new ImGuiController(_gd, _gd.MainSwapchain.Framebuffer.OutputDescription, _window.Width, _window.Height);
            //_memoryEditor = new MemoryEditor();
            //Random random = new Random();
            //_memoryEditorData = Enumerable.Range(0, 1024).Select(i => (byte)random.Next(255)).ToArray();
            _state = new GlobalUIState(_window);
            // Main application loop
            while (_window.Exists)
            {
                InputSnapshot snapshot = _window.PumpEvents();
                if (!_window.Exists)
                {
                    break;
                }
                _controller.Update(1f / 60f, snapshot); // Feed the input events to our ImGui controller, which passes them through to ImGui.

                SubmitUI();

                _cl.Begin();
                _cl.SetFramebuffer(_gd.MainSwapchain.Framebuffer);
                _cl.ClearColorTarget(0, new RgbaFloat(_clearColor.X, _clearColor.Y, _clearColor.Z, 1f));
                _controller.Render(_gd, _cl);
                _cl.End();
                _gd.SubmitCommands(_cl);
                _gd.SwapBuffers(_gd.MainSwapchain);
            }

            // Clean up Veldrid resources
            _gd.WaitForIdle();
            _controller.Dispose();
            _cl.Dispose();
            _gd.Dispose();
        }
Beispiel #7
0
 public override void OnDetach()
 {
     ImGui.SaveIniSettingsToDisk(new DirectoryInfo(Environment.CurrentDirectory).Parent.FullName + @"/imgui.ini");
     ImGuiController?.Dispose();
 }
Beispiel #8
0
 protected override void Unload()
 {
     _imGuiController.Dispose();
     base.Unload();
 }
Beispiel #9
0
 protected virtual void Unload()
 {
     _imGuiController.Dispose();
 }
Beispiel #10
0
 public void Dispose()
 {
     _imGuiController.Dispose();
     glfwTerminate();
 }