Class GraphicsResourceBase
GraphicsResource class
public abstract class GraphicsResourceBase : ComponentBase, IDisposable, IComponent, IReferencable, ICollectorHolder
- Inheritance
-
GraphicsResourceBase
- Implements
- Derived
- Inherited Members
- Extension Methods
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
device
GraphicsDeviceThe device.
GraphicsResourceBase(GraphicsDevice, string)
Initializes a new instance of the GraphicsResourceBase class.
protected GraphicsResourceBase(GraphicsDevice device, string name)
Parameters
device
GraphicsDeviceThe device.
name
stringThe name.
Fields
Reload
public Action<GraphicsResourceBase, IServiceRegistry> Reload
Field Value
Properties
GraphicsDevice
Gets the graphics device attached to this instance.
public GraphicsDevice GraphicsDevice { get; }
Property Value
- GraphicsDevice
The graphics device.
NativeDevice
protected Device NativeDevice { get; }
Property Value
- Device
NativeDeviceChild
Gets or sets the device child.
protected DeviceChild NativeDeviceChild { get; set; }
Property Value
- DeviceChild
The device child.
NativeResource
protected Resource NativeResource { get; }
Property Value
- Resource
Methods
Destroy()
Disposes of object resources.
protected override void 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
OnRecreate()
Called when graphics device has been recreated.
protected virtual bool OnRecreate()
Returns
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