Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    GraphicsPresenter Class

    Namespace: Stride.Graphics
    Assembly: Stride.Graphics.dll

    This class is a frontend to and .

    System.Object → DisposeBase → ComponentBase → GraphicsPresenter
    Derived from GraphicsPresenter: RenderTargetGraphicsPresenter SwapChainGraphicsPresenter

    public abstract class GraphicsPresenter : ComponentBase, IDisposable, IComponent, IReferencable, ICollectorHolder
    Remarks

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

    Name Description
    Constructors
    GraphicsPresenter(GraphicsDevice, PresentationParameters)

    Initializes a new instance of the GraphicsPresenter class.

    Properties
    BackBuffer

    Gets the default back buffer for this presenter.

    DepthStencilBuffer

    Gets the default depth stencil buffer for this presenter.

    Description

    Gets the description of this presenter.

    GraphicsDevice

    Gets the graphics device.

    IsFullScreen

    Gets or sets fullscreen mode for this presenter.

    NativePresenter

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

    PresentInterval

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

    Methods
    BeginDraw(CommandList)
    CreateDepthStencilBuffer()

    Creates the depth stencil buffer.

    Destroy()
    EndDraw(CommandList, Boolean)
    OnDestroyed()

    Called when [destroyed].

    OnRecreated()

    Called when [recreated].

    Present()

    Presents the Backbuffer to the screen.

    ProcessPresentationParameters()
    ReleaseCurrentDepthStencilBuffer()
    Resize(Int32, Int32, PixelFormat)

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

    ResizeBackBuffer(Int32, Int32, PixelFormat)
    ResizeDepthStencilBuffer(Int32, Int32, PixelFormat)
    | Improve this Doc View Source

    Constructors


    GraphicsPresenter(GraphicsDevice, PresentationParameters)

    Initializes a new instance of the GraphicsPresenter class.

    protected GraphicsPresenter(GraphicsDevice device, PresentationParameters presentationParameters)
    Parameters
    Type Name Description
    GraphicsDevice device

    The device.

    PresentationParameters presentationParameters
    | Improve this Doc View Source

    Properties


    BackBuffer

    Gets the default back buffer for this presenter.

    public abstract Texture BackBuffer { get; }
    Property Value
    Type Description
    Texture

    DepthStencilBuffer

    Gets the default depth stencil buffer for this presenter.

    public Texture DepthStencilBuffer { get; protected set; }
    Property Value
    Type Description
    Texture

    Description

    Gets the description of this presenter.

    public PresentationParameters Description { get; }
    Property Value
    Type Description
    PresentationParameters

    GraphicsDevice

    Gets the graphics device.

    public GraphicsDevice GraphicsDevice { get; }
    Property Value
    Type Description
    GraphicsDevice

    The graphics device.


    IsFullScreen

    Gets or sets fullscreen mode for this presenter.

    public abstract bool IsFullScreen { get; set; }
    Property Value
    Type Description
    System.Boolean

    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
    Type Description
    System.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
    Type Description
    PresentInterval

    The present interval.

    | Improve this Doc View Source

    Methods


    BeginDraw(CommandList)

    public virtual void BeginDraw(CommandList commandList)
    Parameters
    Type Name Description
    CommandList commandList

    CreateDepthStencilBuffer()

    Creates the depth stencil buffer.

    protected virtual void CreateDepthStencilBuffer()

    Destroy()

    protected override void Destroy()
    Overrides
    ComponentBase.Destroy()

    EndDraw(CommandList, Boolean)

    public virtual void EndDraw(CommandList commandList, bool present)
    Parameters
    Type Name Description
    CommandList commandList
    System.Boolean present

    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(Int32, Int32, 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
    Type Name Description
    System.Int32 width
    System.Int32 height
    PixelFormat format

    ResizeBackBuffer(Int32, Int32, PixelFormat)

    protected abstract void ResizeBackBuffer(int width, int height, PixelFormat format)
    Parameters
    Type Name Description
    System.Int32 width
    System.Int32 height
    PixelFormat format

    ResizeDepthStencilBuffer(Int32, Int32, PixelFormat)

    protected abstract void ResizeDepthStencilBuffer(int width, int height, PixelFormat format)
    Parameters
    Type Name Description
    System.Int32 width
    System.Int32 height
    PixelFormat format

    Inherited Members

    ComponentBase.Tags
    ComponentBase.Name
    ComponentBase.ICollectorHolder.Collector
    ComponentBase.OnNameChanged()
    ComponentBase.ToString()
    DisposeBase.Dispose()
    DisposeBase.IsDisposed
    DisposeBase.IReferencable.ReferenceCount
    DisposeBase.IReferencable.AddReference()
    DisposeBase.IReferencable.Release()
    DisposeBase.OnAddReference()
    DisposeBase.OnReleaseReference()

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation