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

Interface IDalamudTextureWrap

Base TextureWrap interface for all Dalamud-owned texture wraps. Used to avoid referencing ImGuiScene.

Remarks​

If you want to implement this, see if you're actually wrapping an existing instance of Dalamud.Interface.Textures.TextureWraps.IDalamudTextureWrap; if you are, then use Dalamud.Interface.Textures.TextureWraps.ForwardingTextureWrap.

Assembly: Dalamud.dll​
Declaration
public interface IDalamudTextureWrap : IDisposable

Derived:
Dalamud.Interface.Textures.TextureWraps.ForwardingTextureWrap

Properties​

Handle​

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

Declaration
ImTextureID Handle { get; }

Width​

Gets the width of the texture.

Declaration
int Width { get; }

Height​

Gets the height of the texture.

Declaration
int Height { get; }

Size​

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

Declaration
Vector2 Size { get; }

Methods​

CreateWrapSharingLowLevelResource()​

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

Declaration
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.