/// <summary> /// Disposes the control. /// </summary> protected override void Dispose(bool disposing) { if (DesignMode) { return; } Global.IsRunning = false; WinDispose(); Display.Dispose(); Resources.Dispose(); Logger.Log("Resources disposed."); InputManager.Dispose(); Logger.Log("Input Manager disposed."); ShaderManager.Dispose(); Logger.Log("Shaders disposed."); //GC.SuppressFinalize(this); base.Dispose(disposing); }
/// <summary> /// This call configure the graphic library for the new device instance. /// </summary> public override void InvalidateDevice() { base.InvalidateDevice(); // - Wait the GPU (we must operate only when GPU is idle) GraphicDevice.Handle.WaitIdle(); // - Dispose render pass DefaultRenderPass.Dispose(); // - Dispose the pipeline Pipeline.Dispose(); // - Dipose current swapchain Swapchain.Dispose(); // - Dispose current VK surface DrawingSurface.Dispose(); // - Dispose vertex and index managers VertexManager.Dispose(); IndexManager.Dispose(); // - Release all VK shaders ShaderManager.Dispose(); for (int i = 0; i < MaxFrameInFlight; ++i) { if (CommandBuffers[i] != null) { foreach (var buffer in CommandBuffers[i]) { buffer.Reset(); } Commands[i].FreeCommandBuffers(CommandBuffers[i]); } } foreach (Fence fence in InFlightFences) { fence.Destroy(); } foreach (Semaphore sem in ImageAvailableSemaphores) { sem.Destroy(); } foreach (Semaphore sem in RenderFinishedSemaphores) { sem.Destroy(); } // - Dispose device GraphicDevice.Dispose(); // - Initialize device Initialize(); // - Reconfigure the renderer ConfigureRendering(); }
public static void Terminate() { if (IsInitialized) { Logger.Trace <ID3D11Device>("Disposing managers"); ReleaseBackbuffer(); BufferManager.Dispose(); BufferManager = null; TextureManager.Dispose(); TextureManager = null; SamplerManager.Dispose(); SamplerManager = null; ShaderManager.Dispose(); ShaderManager = null; RasterizerManager.Dispose(); RasterizerManager = null; SwapChain.Dispose(); SwapChain = null; Logger.Trace <ID3D11Device>("Disposing resources"); _swapChain.Dispose(); _context.Dispose(); _device.Dispose(); } IsInitialized = false; }
/// <summary> /// Implement IDisposable. /// </summary> protected override void Dispose(bool disposing) { base.Dispose(disposing); GraphicDevice.Handle.WaitForFences(InFlightFences.ToArray(), true, UInt64.MaxValue); // - Wait the GPU (we must operate only when GPU is idle) GraphicDevice.Handle.WaitIdle(); // - Dispose render pass DefaultRenderPass.Dispose(); // - Dispose the pipeline Pipeline.Dispose(); // - Dipose current swapchain Swapchain.Dispose(); // - Dispose vertex and index managers VertexManager.Dispose(); IndexManager.Dispose(); // - Release all VK shaders ShaderManager.Dispose(); for (int i = 0; i < MaxFrameInFlight; ++i) { if (CommandBuffers[i] != null) { foreach (var buffer in CommandBuffers[i]) { buffer.Reset(); } } } foreach (CommandPool pool in Commands) { pool?.Destroy(); } foreach (Fence fence in InFlightFences) { fence?.Destroy(); } foreach (Semaphore sem in ImageAvailableSemaphores) { sem?.Destroy(); } foreach (Semaphore sem in RenderFinishedSemaphores) { sem?.Destroy(); } // - Dispose device GraphicDevice.Dispose(); // - Dispose vulkan Library.Dispose(); }
protected void Dispose(bool disposing) { if (isDisposed) { return; } isDisposed = true; SampleStore?.Dispose(); TextureStore?.Dispose(); ShaderManager?.Dispose(); RulesetConfigManager = null; }
protected override void OnUnload() { GL.BindBuffer(BufferTarget.ArrayBuffer, 0); // Unload all entities foreach (Entity.Entity entity in Entities) { entity.OnUnload(); } // Dispose shaders ShaderManager.Dispose(); base.OnUnload(); }
protected virtual void Dispose(bool disposing) { if (!disposedValue) { foreach (var clipping_mask in ClippingMasks) { clipping_mask.Dispose(); } foreach (var texture in Textures) { texture.Dispose(); } ShaderManager.Dispose(); disposedValue = true; } }
private static void OnDispose() { Global.IsRunning = false; Logger.Log("Fullscreen disabled."); FontManager.Dispose(); Logger.Log("FontManager disposed."); Resources.Dispose(); Logger.Log("Resources disposed."); InputManager.Dispose(); Logger.Log("Input Manager disposed."); ShaderManager.Dispose(); Logger.Log("Shaders disposed."); Display.Dispose(); }
public void Dispose() { _player = null; _frameCounter = null; _camera = null; _frustrum = null; _skyPlane.ShurDown(); _skyPlane = null; _skyDome.ShutDown(); _skyDome = null; _quadTree?.Shutdown(); _quadTree = null; _foliage?.Dispose(); _foliage = null; _groundModel?.Dispose(); _groundModel = null; _terrain?.Dispose(); _terrain = null; _userInterface?.Dispose(); _userInterface = null; _shaderManager?.Dispose(); _shaderManager = null; _input?.Dispose(); _input = null; _directX?.Dispose(); _directX = null; }
protected virtual void Dispose(bool isDisposing) { if (ShaderManager != null) { ShaderManager.Dispose(); } if (RenderStatePool != null) { RenderStatePool.Dispose(); } if (GraphicsDevice != null) { GraphicsDevice.Dispose(); } if (AudioDevice != null) { AudioDevice.Dispose(); } if (onStart != null) { onStart.Dispose(); } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); primary?.Dispose(); }