diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/TexWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/TexWidget.cs index 9277d01f3..d40544def 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/TexWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/TexWidget.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Numerics; @@ -469,7 +469,7 @@ internal class TexWidget : IDataWindowWidget { _ = Service.Get().ShowTextureSaveMenuAsync( this.DisplayName, - $"{wrap.ImGuiHandle:X16}", + $"{wrap.Handle.Handle:X16}", Task.FromResult(wrap.CreateWrapSharingLowLevelResource())); } diff --git a/Dalamud/Interface/Textures/DalamudTextureWrapExtensions.cs b/Dalamud/Interface/Textures/DalamudTextureWrapExtensions.cs index 7f8f02c7e..e786d373c 100644 --- a/Dalamud/Interface/Textures/DalamudTextureWrapExtensions.cs +++ b/Dalamud/Interface/Textures/DalamudTextureWrapExtensions.cs @@ -1,4 +1,3 @@ -using Dalamud.Interface.Internal; using Dalamud.Interface.Textures.TextureWraps; namespace Dalamud.Interface.Textures; @@ -17,6 +16,6 @@ public static class DalamudTextureWrapExtensions return false; if (a is null) return false; - return a.ImGuiHandle == b.ImGuiHandle; + return a.Handle == b.Handle; } } diff --git a/Dalamud/Interface/Textures/Internal/TextureManager.BlameTracker.cs b/Dalamud/Interface/Textures/Internal/TextureManager.BlameTracker.cs index 673d40d18..837b41271 100644 --- a/Dalamud/Interface/Textures/Internal/TextureManager.BlameTracker.cs +++ b/Dalamud/Interface/Textures/Internal/TextureManager.BlameTracker.cs @@ -66,7 +66,7 @@ internal sealed partial class TextureManager try { - if (textureWrap.ImGuiHandle == nint.Zero) + if (textureWrap.Handle.IsNull) return textureWrap; } catch (ObjectDisposedException) @@ -103,7 +103,7 @@ internal sealed partial class TextureManager try { - if (textureWrap.ImGuiHandle == nint.Zero) + if (textureWrap.Handle.IsNull) return textureWrap; } catch (ObjectDisposedException) diff --git a/Dalamud/Interface/Textures/TextureWraps/IDalamudTextureWrap.cs b/Dalamud/Interface/Textures/TextureWraps/IDalamudTextureWrap.cs index f58c167ed..b30adced7 100644 --- a/Dalamud/Interface/Textures/TextureWraps/IDalamudTextureWrap.cs +++ b/Dalamud/Interface/Textures/TextureWraps/IDalamudTextureWrap.cs @@ -2,7 +2,6 @@ using System.Numerics; using Dalamud.Bindings.ImGui; using Dalamud.Interface.Textures.TextureWraps.Internal; -using Dalamud.Utility; using TerraFX.Interop.Windows; @@ -19,10 +18,6 @@ public interface IDalamudTextureWrap : IDisposable /// Gets a texture handle suitable for direct use with ImGui functions. ImTextureID Handle { get; } - /// Gets a texture handle suitable for direct use with ImGui functions. - [ImGuiBindingsToDo("Remove.")] - IntPtr ImGuiHandle => new((long)this.Handle.Handle); - /// Gets the width of the texture. int Width { get; } @@ -38,7 +33,7 @@ public interface IDalamudTextureWrap : IDisposable /// The new reference to this texture wrap. /// /// On calling this function, a new instance of will be returned, but with - /// the same . The new instance must be d, as the backing + /// the same . The new instance must be d, 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.
@@ -46,7 +41,7 @@ public interface IDalamudTextureWrap : IDisposable /// 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 as an . + /// The default implementation will treat as an . ///
unsafe IDalamudTextureWrap CreateWrapSharingLowLevelResource() { diff --git a/Dalamud/Interface/Textures/TextureWraps/Internal/DrawListTextureWrap.cs b/Dalamud/Interface/Textures/TextureWraps/Internal/DrawListTextureWrap.cs index 9f2ef9f78..13878abe2 100644 --- a/Dalamud/Interface/Textures/TextureWraps/Internal/DrawListTextureWrap.cs +++ b/Dalamud/Interface/Textures/TextureWraps/Internal/DrawListTextureWrap.cs @@ -60,7 +60,7 @@ internal sealed unsafe partial class DrawListTextureWrap : IDrawListTextureWrap, this.device.Get()->GetImmediateContext(pdc); this.emptyTexture = emptyTexture; - this.srv = new((ID3D11ShaderResourceView*)emptyTexture.ImGuiHandle); + this.srv = new((ID3D11ShaderResourceView*)emptyTexture.Handle.Handle); } /// Finalizes an instance of the class. @@ -226,7 +226,7 @@ internal sealed unsafe partial class DrawListTextureWrap : IDrawListTextureWrap, this.rtvPremultiplied.Reset(); this.width = newWidth; this.Height = newHeight; - this.srv = new((ID3D11ShaderResourceView*)this.emptyTexture.ImGuiHandle); + this.srv = new((ID3D11ShaderResourceView*)this.emptyTexture.Handle.Handle); return S.S_FALSE; } diff --git a/Dalamud/Interface/Utility/Internal/DevTextureSaveMenu.cs b/Dalamud/Interface/Utility/Internal/DevTextureSaveMenu.cs index 38b46d0c2..4ed6b4e48 100644 --- a/Dalamud/Interface/Utility/Internal/DevTextureSaveMenu.cs +++ b/Dalamud/Interface/Utility/Internal/DevTextureSaveMenu.cs @@ -64,7 +64,7 @@ internal sealed class DevTextureSaveMenu : IInternalDisposableService var initiatorScreenOffset = ImGui.GetMousePos(); using var textureWrap = await texture; var textureManager = await Service.GetAsync(); - var popupName = $"{nameof(this.ShowTextureSaveMenuAsync)}_{textureWrap.ImGuiHandle:X}"; + var popupName = $"{nameof(this.ShowTextureSaveMenuAsync)}_{textureWrap.Handle.Handle:X}"; BitmapCodecInfo? encoder; { diff --git a/Dalamud/Utility/ImGuiBindingsToDoAttribute.cs b/Dalamud/Utility/ImGuiBindingsToDoAttribute.cs deleted file mode 100644 index 60f15c056..000000000 --- a/Dalamud/Utility/ImGuiBindingsToDoAttribute.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace Dalamud.Utility; - -/// -/// Utility class for marking something to be changed for when the new bindings are fully adopted, for ease of lookup. -/// -[AttributeUsage(AttributeTargets.All, Inherited = false)] -internal sealed class ImGuiBindingsToDoAttribute : Attribute -{ - /// - /// Marks that this should be made internal. - /// - public const string MakeInternal = "Make internal."; - - /// - /// Initializes a new instance of the class. - /// - /// The explanation. - /// The explanation 2. - public ImGuiBindingsToDoAttribute(string what, string what2 = "") - { - _ = what; - _ = what2; - } -}