Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    GraphicsResourceBase Class

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

    GraphicsResource class

    System.Object → DisposeBase → ComponentBase → GraphicsResourceBase
    Derived from GraphicsResourceBase: CommandList DescriptorPool DescriptorSetLayout GraphicsResource PipelineState QueryPool RootSignature SamplerState

    public abstract class GraphicsResourceBase : ComponentBase, IDisposable, IComponent, IReferencable, ICollectorHolder
    Name Description
    Constructors
    GraphicsResourceBase()

    Initializes a new instance of the GraphicsResourceBase class.

    GraphicsResourceBase(GraphicsDevice)

    Initializes a new instance of the GraphicsResourceBase class.

    GraphicsResourceBase(GraphicsDevice, String)

    Initializes a new instance of the GraphicsResourceBase class.

    Fields
    Reload
    Properties
    GraphicsDevice

    Gets the graphics device attached to this instance.

    NativeDevice
    NativeDeviceChild

    Gets or sets the device child.

    NativeResource
    Methods
    Destroy()

    Disposes of object resources.

    OnDestroyed()

    Called when graphics device has been detected to be internally destroyed.

    OnPause()

    Called when graphics device is inactive (put in the background and rendering is paused). It should voluntarily release objects that can be easily recreated, such as FBO and dynamic buffers.

    OnRecreate()

    Called when graphics device has been recreated.

    OnResume()

    Called when graphics device is resumed from either paused or destroyed state. If possible, resource should be recreated.

    Events
    Destroyed

    Raised when the internal graphics resource gets destroyed. This event is useful when user allocated handles associated with the internal resource need to be released.

    | Improve this Doc View Source

    Constructors


    GraphicsResourceBase()

    Initializes a new instance of the GraphicsResourceBase class.

    protected GraphicsResourceBase()

    GraphicsResourceBase(GraphicsDevice)

    Initializes a new instance of the GraphicsResourceBase class.

    protected GraphicsResourceBase(GraphicsDevice device)
    Parameters
    Type Name Description
    GraphicsDevice device

    The device.


    GraphicsResourceBase(GraphicsDevice, String)

    Initializes a new instance of the GraphicsResourceBase class.

    protected GraphicsResourceBase(GraphicsDevice device, string name)
    Parameters
    Type Name Description
    GraphicsDevice device

    The device.

    System.String name

    The name.

    | Improve this Doc View Source

    Fields


    Reload

    public Action<GraphicsResourceBase> Reload
    Field Value
    Type Description
    System.Action<GraphicsResourceBase>
    | Improve this Doc View Source

    Properties


    GraphicsDevice

    Gets the graphics device attached to this instance.

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

    The graphics device.


    NativeDevice

    protected Device NativeDevice { get; }
    Property Value
    Type Description
    SharpDX.Direct3D11.Device

    NativeDeviceChild

    Gets or sets the device child.

    protected DeviceChild NativeDeviceChild { get; set; }
    Property Value
    Type Description
    SharpDX.Direct3D11.DeviceChild

    The device child.


    NativeResource

    protected Resource NativeResource { get; }
    Property Value
    Type Description
    SharpDX.Direct3D11.Resource
    | Improve this Doc View Source

    Methods


    Destroy()

    Disposes of object resources.

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

    OnDestroyed()

    Called when graphics device has been detected to be internally destroyed.

    protected virtual void OnDestroyed()

    OnPause()

    Called when graphics device is inactive (put in the background and rendering is paused). It should voluntarily release objects that can be easily recreated, such as FBO and dynamic buffers.

    protected virtual bool OnPause()
    Returns
    Type Description
    System.Boolean

    True if item transitioned to a Paused state.


    OnRecreate()

    Called when graphics device has been recreated.

    protected virtual bool OnRecreate()
    Returns
    Type Description
    System.Boolean

    True if item transitioned to a Active state.


    OnResume()

    Called when graphics device is resumed from either paused or destroyed state. If possible, resource should be recreated.

    protected virtual void OnResume()
    | Improve this Doc View Source

    Events


    Destroyed

    Raised when the internal graphics resource gets destroyed. This event is useful when user allocated handles associated with the internal resource need to be released.

    public event EventHandler<EventArgs> Destroyed
    Event Type
    Type Description
    System.EventHandler<System.EventArgs>

    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