Click or drag to resize
AB4D logo

RenderingContext Methods

The RenderingContext type exposes the following members.

Methods
 NameDescription
Public methodDispose Dispose
Public methodGetBackBufferChangesReport GetBackBufferChangesReport returns a string that contains all the BackBuffer changes and the RenderingStep names. To get results first set IsCollectingBackBufferChanges to true, render the scene again and then call this method. DebugName for DirectX resources need to be set to see any meaningful reports.
Public methodRegisterBackBufferMapping(BackBufferReadyEventHandler) RegisterBackBufferMapping method is used to register a specified callback delegate that is called only once when the next frame is rendered. The render frame is also rendered into a special staging back buffer and that buffer is mapped so it can be accessed by the CPU (copied into main memory). This method creates an ad-hoc staging back buffer that is disposed after the stagingBackBufferMappedCallback is called. If you want to get multiple frames or specify your own staging back buffer the use the RegisterBackBufferMapping(Texture2D, Texture2DDescription, BackBufferReadyEventHandler) method.
Public methodRegisterBackBufferMapping(Texture2D, Texture2DDescription, BackBufferReadyEventHandler) RegisterBackBufferMapping registers the FinalBackBuffer to be accessable to the main memory. This is done with specifying the stagingBackBuffer that is used as intermediate buffer that can be mapped and then accessed by the CPU. The stagingBackBuffer must be created with Usage set to Staging and CpuAccessFlags set to Read. When the stagingBackBuffer is ready to be accessed (is mapped), the stagingBackBufferMappedCallback delegate is called.
Public methodSetBackBuffer Changes the current BackBuffer and its RenderTargetView and DepthStencilView. With setting bindNewRenderTargetsToDeviceContext to true, it is also possible to call SetRenderTargets method on the DeviceContext.OutputMerger and change the currently bind RenderTargetView and DepthStencilView. The specified back buffer will be used for the following rendering steps. If the specified back buffer is different from the FinalBackBuffer, then the back buffer will be copied or resolved (in case of MSAA back buffer) into FinalBackBuffer at the end of rendering.
Public methodSetSupersamplingBackBuffers Sets the CurrentSupersamplingCount and the super-sampled back buffer and its ShaderResourceView.
Public methodUnregisterAllBackBufferMappings Unregisters all delegates that were registered with the RegisterBackBufferMapping(Texture2D, Texture2DDescription, BackBufferReadyEventHandler) methods. The method also sets the StagingBackBuffer to null and resets the StagingBackBufferDescription to empty values.
Public methodUnregisterBackBufferMapping Unregisters the stagingBackBufferMappedCallback delegate that was registered with the RegisterBackBufferMapping(Texture2D, Texture2DDescription, BackBufferReadyEventHandler) method. When all the callbacks are unregistered the StagingBackBuffer and StagingBackBufferMappedCallbacks are set to null and StagingBackBufferDescription is reset to empty values.
Top
See Also