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
nintThe 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
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
TextureHandleAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
obj
objectThe 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
TextureHandleright
TextureHandle
Returns
operator ==(TextureHandle, nint)
public static bool operator ==(TextureHandle left, nint right)
Parameters
left
TextureHandleright
nint
Returns
operator ==(nint, TextureHandle)
public static bool operator ==(nint left, TextureHandle right)
Parameters
left
nintright
TextureHandle
Returns
implicit operator nint(TextureHandle)
public static implicit operator nint(TextureHandle handle)
Parameters
handle
TextureHandle
Returns
implicit operator TextureHandle(nint)
public static implicit operator TextureHandle(nint handle)
Parameters
handle
nint
Returns
operator !=(TextureHandle, TextureHandle)
public static bool operator !=(TextureHandle left, TextureHandle right)
Parameters
left
TextureHandleright
TextureHandle
Returns
operator !=(TextureHandle, nint)
public static bool operator !=(TextureHandle left, nint right)
Parameters
left
TextureHandleright
nint
Returns
operator !=(nint, TextureHandle)
public static bool operator !=(nint left, TextureHandle right)
Parameters
left
nintright
TextureHandle