コード例 #1
0
ファイル: GpuSurfaceManager.cs プロジェクト: limocute/yak2d
        public void RegisterSwapChainOutput(Framebuffer swapChainFrameBuffer, bool removeExisting)
        {
            if (removeExisting)
            {
                if (!_surfaceCollection.Remove(MainSwapChainFrameBufferKey))
                {
                    _frameworkMessenger.Report("The removal of a surface that caused an error was due to trying to remove a swapchain render target on recreation. Shouldn't happen!");
                }
            }

            var surface = _gpuSurfaceFactory.CreateSurfaceFromSwapChainOutputBuffer(swapChainFrameBuffer);

            MainSwapChainFrameBufferKey = _idGenerator.New();

            if (!_surfaceCollection.Add(MainSwapChainFrameBufferKey, surface))
            {
                _frameworkMessenger.Report("Error trying to add new swapchain output as new gpusurface to collection");
            }
        }
コード例 #2
0
ファイル: GpuSurfaceManager.cs プロジェクト: AlzPatz/yak2d
        public void ProcessPendingDestruction()
        {
            _surfacesForDestruction.ForEach(id =>
            {
                _surfaceCollection.Remove(id);

                if (_surfacesToAutoClearDepth.Contains(id))
                {
                    _surfacesToAutoClearDepth.Remove(id);
                }

                if (_surfacesToAutoClearColour.Contains(id))
                {
                    _surfacesToAutoClearColour.Remove(id);
                }
            });

            _surfacesForDestruction.Clear();
        }