Interface IGorgonSharedResource
Provides the ability return a shared resource for passing objects to other APIs.
Inherited Members
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public interface IGorgonSharedResource : IGorgonNativeResource
Methods
| Edit this page View SourceAcquire(long, int)
Function to acquire the mutex for the texture.
Declaration
void Acquire(long key, int timeOut)
Parameters
Type | Name | Description |
---|---|---|
long | key | The key to use for the mutex. |
int | timeOut | The number of milliseconds that the mutex should last for. Use MaxValue for an indefinite timeout. |
Remarks
Calls to this method must be matched with a call to Release(long) to avoid issues with leakage.
This method will only work with textures that have a value of SharedKeyedMutex assigned to Shared.
GetSharedHandle()
Function to retrieve the shared resource handle for this resource.
Declaration
nint GetSharedHandle()
Returns
Type | Description |
---|---|
nint | A pointer representing a handle for sharing the resource data with other interfaces. |
Remarks
This is used to retrieve a handle to the shared resource that allows applications to share the resource with other APIs (e.g. Direct 2D).
This method will only work with textures that have a value of SharedKeyedMutex, or Shared assigned to Shared.
Release(long)
Function to release a previously acquired mutex for the texture.
Declaration
void Release(long key)
Parameters
Type | Name | Description |
---|---|---|
long | key | The key used for the mutex. |
Remarks
This method must be called when a call to Acquire(long, int) is made, and the mutex is no longer required.
This method will only work with textures that have a value of SharedKeyedMutex assigned to Shared.