Class GorgonGraphicsResource
A base resource class for resource objects such as textures and buffers.
Inheritance
Inherited Members
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public abstract class GorgonGraphicsResource : IGorgonNamedObject, IGorgonGraphicsObject, IGorgonNativeResource, IDisposable
Remarks
Objects that inherit from this class will be considered a resource object that may (depending on usage) be bound to the pipeline.
Constructors
| Edit this page View SourceGorgonGraphicsResource(GorgonGraphics)
Initializes a new instance of the GorgonGraphicsResource class.
Declaration
protected GorgonGraphicsResource(GorgonGraphics graphics)
Parameters
Type | Name | Description |
---|---|---|
GorgonGraphics | graphics | The graphics interface used to create this resource. |
Remarks
Names for the resource are required, but do not need to be unique. These are used to help with debugging and can be used for managing resources in an application.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
Properties
| Edit this page View SourceEvictionPriority
Property to set or return the
Declaration
public EvictionPriority EvictionPriority { get; set; }
Property Value
Type | Description |
---|---|
EvictionPriority |
Graphics
Property to return the graphics interface used to create this object.
Declaration
public GorgonGraphics Graphics { get; }
Property Value
Type | Description |
---|---|
GorgonGraphics |
IsDisposed
Property to return whether or not the resource is disposed.
Declaration
public bool IsDisposed { get; }
Property Value
Type | Description |
---|---|
bool |
Name
Property to return the name of this object.
Declaration
public abstract string Name { get; }
Property Value
Type | Description |
---|---|
string |
Remarks
For best practises, the name should only be set once during the lifetime of an object. Hence, this interface only provides a read-only implementation of this property.
ResourceType
Property to return the type of data in the resource.
Declaration
public abstract GraphicsResourceType ResourceType { get; }
Property Value
Type | Description |
---|---|
GraphicsResourceType |
SizeInBytes
Property to return the size, in bytes, of the resource.
Declaration
public abstract int SizeInBytes { get; }
Property Value
Type | Description |
---|---|
int |
Usage
Property to return the usage for the resource.
Declaration
public abstract ResourceUsage Usage { get; }
Property Value
Type | Description |
---|---|
ResourceUsage |
Methods
| Edit this page View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public virtual void Dispose()
Remarks
Objects that override this method should be sure to call this base method or else a memory leak may occur.
GetApplicationData(Guid)
Function to return application specific data from the resource.
Declaration
public object GetApplicationData(Guid guid)
Parameters
Type | Name | Description |
---|---|---|
Guid | guid | GUID to associate with the data. |
Returns
Type | Description |
---|---|
object | The data associated with the GUID. |
SetApplicationData(Guid, object)
Function to set application specific data on the resource.
Declaration
public void SetApplicationData(Guid guid, object data)
Parameters
Type | Name | Description |
---|---|---|
Guid | guid | GUID to associate with the data. |
object | data | Data to set. |
Remarks
Set data
to null to remove the data from the resource.