コード例 #1
0
ファイル: DXControl.cs プロジェクト: marwahaha/FacCom
        /// <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);
        }
コード例 #2
0
        /// <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();
        }
コード例 #3
0
    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;
    }
コード例 #4
0
        /// <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();
        }
コード例 #5
0
        protected void Dispose(bool disposing)
        {
            if (isDisposed)
            {
                return;
            }

            isDisposed = true;

            SampleStore?.Dispose();
            TextureStore?.Dispose();
            ShaderManager?.Dispose();
            RulesetConfigManager = null;
        }
コード例 #6
0
ファイル: RenderEngine.cs プロジェクト: edward-brown/RenderMe
        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();
        }
コード例 #7
0
 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;
     }
 }
コード例 #8
0
        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();
        }
コード例 #9
0
ファイル: Window.cs プロジェクト: Dmihawk/Terrain
        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;
        }
コード例 #10
0
ファイル: Engine.cs プロジェクト: K0bin/DotGame
 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();
     }
 }
コード例 #11
0
 protected override void Dispose(bool disposing)
 {
     base.Dispose(disposing);
     primary?.Dispose();
 }