Skip to main content
Version: 15.x (API 15) [Current]

Class ForwardingTextureWrap

Base class for implementations of Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap that forwards to another.

Assembly: Dalamud.dll​
Declaration
public abstract class ForwardingTextureWrap : IDalamudTextureWrap, IDisposable

Implements:
Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap, System.IDisposable

Properties​

Handle​

Gets a texture handle suitable for direct use with ImGui functions.

Declaration
public ImTextureID Handle { get; }

Width​

Gets the width of the texture.

Declaration
public int Width { get; }

Height​

Gets the height of the texture.

Declaration
public int Height { get; }

Size​

Gets the size vector of the texture using Width, Height.

Declaration
public Vector2 Size { get; }

Methods​

Dispose()​

Declaration
public void Dispose()

CreateWrapSharingLowLevelResource()​

Creates a new reference to the resource being pointed by this instance of Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap.

Declaration
public virtual IDalamudTextureWrap CreateWrapSharingLowLevelResource()
Returns​

Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap: The new reference to this texture wrap.

Remarks​

On calling this function, a new instance of Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap will be returned, but with the same Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap.Handle. The new instance must be System.IDisposable.Disposed, as the backing resource will stay alive until all the references are released. The old instance may be disposed as needed, once this function returns; the new instance will stay alive regardless of whether the old instance has been disposed.

Primary purpose of this function is to share textures across plugin boundaries. When texture wraps get passed across plugin boundaries for use for an indeterminate duration, the receiver should call this function to obtain a new reference to the texture received, so that it gets its own "copy" of the texture and the caller may dispose the texture anytime without any care for the receiver.

The default implementation will treat Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap.Handle as an TerraFX.Interop.Windows.IUnknown.

ToString()​

Declaration
public override string ToString()
Returns​

System.String

Dispose(bool)​

Called on System.IDisposable.Dispose.

Declaration
protected virtual void Dispose(bool disposing)
Parameters​
TypeNameDescription
System.Booleandisposingtrue if called from System.IDisposable.Dispose.
Remarks​

<p>Base implementation will not dispose the result of Dalamud.Interface.Textures.TextureWraps.ForwardingTextureWrap.TryGetWrap(Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap@).</p> <p>If you need to implement a finalizer, then make it call this function with false.</p>

TryGetWrap(out IDalamudTextureWrap?)​

Gets the inner wrap.

Declaration
protected abstract bool TryGetWrap(out IDalamudTextureWrap? wrap)
Returns​

System.Boolean: true if not disposed and <code class="paramref">wrap</code> is available.

Parameters​
TypeNameDescription
Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrapwrapThe inner wrap.

GetWrap()​

Gets the inner wrap.

Declaration
protected IDalamudTextureWrap GetWrap()
Returns​

Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap: The inner wrap.

Implements​