IRenderTargetBackBufferUtilitiesΒΆ

interface IRenderTargetBackBufferUtilities

This services provides utility methods for making render targets match the backbuffer.

RenderTarget2D UpdateRenderTarget(RenderTarget2D renderTarget, IGameContext gameContext)

Given an existing (or null) render target, returns either the existing render target, or disposes the existing render target and creates a new one so that the returned render target matches the backbuffer.

Parameters:
  • renderTarget (Microsoft.Xna.Framework.Graphics.RenderTarget2D) – The existing render target, which is either returned or disposed.
  • gameContext (Protogame.IGameContext) – The current game context.
Returns:

A render target that matches the backbuffer.

RenderTarget2D UpdateCustomRenderTarget(RenderTarget2D renderTarget, IGameContext gameContext, System.Nullable<SurfaceFormat> surfaceFormat, System.Nullable<DepthFormat> depthFormat, System.Nullable<Int32> multiSampleCount)

Given an existing (or null) render target, returns either the existing render target, or disposes the existing render target and creates a new one so that the returned render target matches the backbuffer size, with a custom surface format and no depth buffer.

Parameters:
  • renderTarget (Microsoft.Xna.Framework.Graphics.RenderTarget2D) – The existing render target, which is either returned or disposed.
  • gameContext (Protogame.IGameContext) – The current game context.
  • surfaceFormat (System.Nullable<SurfaceFormat>) – The surface format to use.
  • depthFormat (System.Nullable<DepthFormat>) –
  • multiSampleCount (System.Nullable<Int32>) –
Returns:

A render target that matches the backbuffer in size.

bool IsRenderTargetOutOfDate(RenderTarget2D renderTarget, IGameContext gameContext)

Returns whether the specified render target matches the backbuffer.

Parameters:
  • renderTarget (Microsoft.Xna.Framework.Graphics.RenderTarget2D) – The render target to check.
  • gameContext (Protogame.IGameContext) – The current game context.
Returns:

Whether the specified render target matches the backbuffer.

bool IsCustomRenderTargetOutOfDate(RenderTarget2D renderTarget, IGameContext gameContext, System.Nullable<SurfaceFormat> surfaceFormat, System.Nullable<DepthFormat> depthFormat, System.Nullable<Int32> multiSampleCount)

Returns whether the specified custom render target matches the backbuffer size and specified surface format.

Parameters:
  • renderTarget (Microsoft.Xna.Framework.Graphics.RenderTarget2D) – The render target to check.
  • gameContext (Protogame.IGameContext) – The current game context.
  • surfaceFormat (System.Nullable<SurfaceFormat>) – The surface format to use.
  • depthFormat (System.Nullable<DepthFormat>) –
  • multiSampleCount (System.Nullable<Int32>) –
Returns:

Whether the specified render target matches the backbuffer size and specified surface format.