GraphicsResourceBase Class
Namespace: Stride.GraphicsAssembly: Stride.Graphics.dll
GraphicsResource class
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. |
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. |
Fields
Reload
public Action<GraphicsResourceBase> Reload
Field Value
Type | Description |
---|---|
System.Action<GraphicsResourceBase> |
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 |
Methods
Destroy()
Disposes of object resources.
protected override void Destroy()
Overrides
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()
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> |