public void RegisterSwapChainOutput(Framebuffer swapChainFrameBuffer, bool removeExisting) { if (removeExisting) { DestroySurface(MainSwapChainFrameBufferKey); } 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"); } }
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"); } }