Table of Contents

Class GraphicsPresenter

Namespace
Stride.Graphics
Assembly
Stride.Graphics.dll

This class is a frontend to SharpDX.DXGI.SwapChain and SharpDX.DXGI.SwapChain1.

public abstract class GraphicsPresenter : ComponentBase, IDisposable, IComponent, IReferencable, ICollectorHolder
Inheritance
object
GraphicsPresenter
Implements
Derived
Inherited Members
Extension Methods

Remarks

In order to create a new GraphicsPresenter, a GraphicsDevice should have been initialized first.

Constructors

GraphicsPresenter(GraphicsDevice, PresentationParameters)

Initializes a new instance of the GraphicsPresenter class.

protected GraphicsPresenter(GraphicsDevice device, PresentationParameters presentationParameters)

Parameters

device GraphicsDevice

The device.

presentationParameters PresentationParameters

Properties

BackBuffer

Gets the default back buffer for this presenter.

public abstract Texture BackBuffer { get; }

Property Value

Texture

DepthStencilBuffer

Gets the default depth stencil buffer for this presenter.

public Texture DepthStencilBuffer { get; protected set; }

Property Value

Texture

Description

Gets the description of this presenter.

public PresentationParameters Description { get; }

Property Value

PresentationParameters

GraphicsDevice

Gets the graphics device.

public GraphicsDevice GraphicsDevice { get; }

Property Value

GraphicsDevice

The graphics device.

IsFullScreen

Gets or sets fullscreen mode for this presenter.

public abstract bool IsFullScreen { get; set; }

Property Value

bool

true if this instance is full screen; otherwise, false.

Remarks

This method is only valid on Windows Desktop and has no effect on Windows Metro.

NativePresenter

Gets the underlying native presenter (can be a SharpDX.DXGI.SwapChain or SharpDX.DXGI.SwapChain1 or null, depending on the platform).

public abstract object NativePresenter { get; }

Property Value

object

The native presenter.

PresentInterval

Gets or sets the PresentInterval. Default is to wait for one vertical blanking.

public PresentInterval PresentInterval { get; set; }

Property Value

PresentInterval

The present interval.

Methods

BeginDraw(CommandList)

public virtual void BeginDraw(CommandList commandList)

Parameters

commandList CommandList

CreateDepthStencilBuffer()

Creates the depth stencil buffer.

protected virtual void CreateDepthStencilBuffer()

Destroy()

Disposes of object resources.

protected override void Destroy()

EndDraw(CommandList, bool)

public virtual void EndDraw(CommandList commandList, bool present)

Parameters

commandList CommandList
present bool

OnDestroyed()

Called when [destroyed].

protected virtual void OnDestroyed()

OnRecreated()

Called when [recreated].

public virtual void OnRecreated()

Present()

Presents the Backbuffer to the screen.

public abstract void Present()

ProcessPresentationParameters()

protected virtual void ProcessPresentationParameters()

ReleaseCurrentDepthStencilBuffer()

protected void ReleaseCurrentDepthStencilBuffer()

Resize(int, int, PixelFormat)

Resizes the current presenter, by resizing the back buffer and the depth stencil buffer.

public void Resize(int width, int height, PixelFormat format)

Parameters

width int
height int
format PixelFormat

ResizeBackBuffer(int, int, PixelFormat)

protected abstract void ResizeBackBuffer(int width, int height, PixelFormat format)

Parameters

width int
height int
format PixelFormat

ResizeDepthStencilBuffer(int, int, PixelFormat)

protected abstract void ResizeDepthStencilBuffer(int width, int height, PixelFormat format)

Parameters

width int
height int
format PixelFormat

SetOutputColorSpace(ColorSpaceType, PixelFormat)

Sets the output color space of the presenter and the format for the backbuffer. Currently only supported by the DirectX backend. Use the following combinations:
Render to SDR Display with gamma 2.2: RgbFullG22NoneP709 with R8G8B8A8_UNorm, R8G8B8A8_UNorm_SRgb, B8G8R8A8_UNorm, B8G8R8A8_UNorm.
Render to HDR Display in scRGB (standard linear), windows DWM will do the color conversion: RgbFullG10NoneP709 with R16G16B16A16_Float
Render to HDR Display in HDR10/BT.2100, no windows DWM conversion, rendering needs to be in the Display color space: RgbFullG2084NoneP2020 with R10G10B10A2_UNorm

public void SetOutputColorSpace(ColorSpaceType colorSpace, PixelFormat format)

Parameters

colorSpace ColorSpaceType
format PixelFormat