Table of Contents

Struct TextureHandle

Namespace
SharpPluginLoader.Core.Rendering
Assembly
SharpPluginLoader.Core.dll

Represents a texture handle that can be passed to ImGui.

public readonly struct TextureHandle : IEquatable<TextureHandle>, IDisposable
Implements
Inherited Members

Remarks

You should generally not have to create instances of this struct yourself. Use LoadTexture(string, out uint, out uint) to load a texture and get a handle.

If for some reason you do need to create a handle manually, the handle should be:
  • For D3D11: A ID3D11ShaderResourceView*
  • For D3D12: A D3D12_GPU_DESCRIPTOR_HANDLE

Constructors

TextureHandle(nint)

Represents a texture handle that can be passed to ImGui.

public TextureHandle(nint handle)

Parameters

handle nint

The handle

Remarks

You should generally not have to create instances of this struct yourself. Use LoadTexture(string, out uint, out uint) to load a texture and get a handle.

If for some reason you do need to create a handle manually, the handle should be:
  • For D3D11: A ID3D11ShaderResourceView*
  • For D3D12: A D3D12_GPU_DESCRIPTOR_HANDLE

Properties

Invalid

An invalid texture handle.

public static TextureHandle Invalid { get; }

Property Value

TextureHandle

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Equals(TextureHandle)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(TextureHandle other)

Parameters

other TextureHandle

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Operators

operator ==(TextureHandle, TextureHandle)

public static bool operator ==(TextureHandle left, TextureHandle right)

Parameters

left TextureHandle
right TextureHandle

Returns

bool

operator ==(TextureHandle, nint)

public static bool operator ==(TextureHandle left, nint right)

Parameters

left TextureHandle
right nint

Returns

bool

operator ==(nint, TextureHandle)

public static bool operator ==(nint left, TextureHandle right)

Parameters

left nint
right TextureHandle

Returns

bool

implicit operator nint(TextureHandle)

public static implicit operator nint(TextureHandle handle)

Parameters

handle TextureHandle

Returns

nint

implicit operator TextureHandle(nint)

public static implicit operator TextureHandle(nint handle)

Parameters

handle nint

Returns

TextureHandle

operator !=(TextureHandle, TextureHandle)

public static bool operator !=(TextureHandle left, TextureHandle right)

Parameters

left TextureHandle
right TextureHandle

Returns

bool

operator !=(TextureHandle, nint)

public static bool operator !=(TextureHandle left, nint right)

Parameters

left TextureHandle
right nint

Returns

bool

operator !=(nint, TextureHandle)

public static bool operator !=(nint left, TextureHandle right)

Parameters

left nint
right TextureHandle

Returns

bool