Class ForwardingTextureWrap
Base class for implementations of Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap that forwards to another.
Assembly: Dalamud.dll
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.
public ImTextureID Handle { get; }
Width
Gets the width of the texture.
public int Width { get; }
Height
Gets the height of the texture.
public int Height { get; }
Size
Gets the size vector of the texture using Width, Height.
public Vector2 Size { get; }
Methods
Dispose()
public void Dispose()
CreateWrapSharingLowLevelResource()
Creates a new reference to the resource being pointed by this instance of Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap.
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()
public override string ToString()
Returns
System.String
Dispose(bool)
Called on System.IDisposable.Dispose.
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
System.Boolean | disposing | true 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.
protected abstract bool TryGetWrap(out IDalamudTextureWrap? wrap)
Returns
System.Boolean: true if not disposed and <code class="paramref">wrap</code> is available.
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap | wrap | The inner wrap. |
GetWrap()
Gets the inner wrap.
protected IDalamudTextureWrap GetWrap()
Returns
Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap: The inner wrap.
Implements
- Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap
System.IDisposable