Skip to main content

Interface ISharedImmediateTexture

A texture with a backing instance of Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap that is shared across multiple requesters.

Assembly: Dalamud.dll
View Source
Declaration
public interface ISharedImmediateTexture

Methods

GetWrapOrEmpty()

Gets the texture for use with the current frame, or an empty texture if unavailable.

View Source
Declaration
IDalamudTextureWrap GetWrapOrEmpty()
Returns

Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap: An instance of Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap that is guaranteed to be available for the current frame being drawn.### GetWrapOrDefault(IDalamudTextureWrap?) Gets the texture for use with the current frame, or a default value specified via <code class="paramref">defaultWrap</code> if unavailable.

View Source
Declaration
IDalamudTextureWrap? GetWrapOrDefault(IDalamudTextureWrap? defaultWrap = null)
Returns

Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap: An instance of Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap that is guaranteed to be available for the current frame being drawn.

Parameters
TypeNameDescription
Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrapdefaultWrapThe default wrap to return if the requested texture was not immediately available.

TryGetWrap(out IDalamudTextureWrap?, out Exception?)

Attempts to get the texture for use with the current frame.

View Source
Declaration
bool TryGetWrap(out IDalamudTextureWrap? texture, out Exception? exception)
Returns

System.Boolean: true if <code class="paramref">texture</code> points to the loaded texture; false if the texture is still being loaded, or the load has failed.

Parameters
TypeNameDescription
Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWraptextureAn instance of Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap that is guaranteed to be available for
the current frame being drawn, or `null` if texture is not loaded (yet). |

| System.Exception | exception | The load exception, if any. |

Exceptions

System.InvalidOperationException
Thrown when called outside the UI thread.

RentAsync(CancellationToken)

<p> Creates a new instance of Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap holding a new reference to this texture. The returned texture is guaranteed to be available until System.IDisposable.Dispose is called. </p> <p> <b>WARNING!</b> Usually, this method should be a "last resort"/compatibility wrapper for old code that does not directly support Dalamud.Interface.Textures.ISharedImmediateTexture directly. Prefer using any of the other methods if possible, and <b>DO NOT CACHE</b> the resulting texture wrap from those functions. </p>

View Source
Declaration
Task<IDalamudTextureWrap> RentAsync(CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task<Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap>: A System.Threading.Tasks.Task%601 containing the loaded texture on success.

Parameters
TypeNameDescription
System.Threading.CancellationTokencancellationTokenThe cancellation token.