Gorgon
Show / Hide Table of Contents

Interface IGorgonSharedResource

Provides the ability return a shared resource for passing objects to other APIs.

Inherited Members
IGorgonNativeResource.Handle
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public interface IGorgonSharedResource : IGorgonNativeResource

Methods

| Edit this page View Source

Acquire(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.

| Edit this page View Source

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.

| Edit this page View Source

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.

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author