diff --git a/Source/ImGui/Private/ImGuiModule.cpp b/Source/ImGui/Private/ImGuiModule.cpp index 3534aeb..828aa83 100644 --- a/Source/ImGui/Private/ImGuiModule.cpp +++ b/Source/ImGui/Private/ImGuiModule.cpp @@ -84,7 +84,7 @@ FImGuiTextureHandle FImGuiModule::FindTextureHandle(const FName& Name) return (Index != INDEX_NONE) ? FImGuiTextureHandle{ Name, ImGuiInterops::ToImTextureID(Index) } : FImGuiTextureHandle{}; } -FImGuiTextureHandle FImGuiModule::RegisterTexture(const FName& Name, class UTexture2D* Texture, bool bMakeUnique) +FImGuiTextureHandle FImGuiModule::RegisterTexture(const FName& Name, class UTexture* Texture, bool bMakeUnique) { FTextureManager& TextureManager = ImGuiModuleManager->GetTextureManager(); diff --git a/Source/ImGui/Private/TextureManager.cpp b/Source/ImGui/Private/TextureManager.cpp index aca56b7..0a062f7 100644 --- a/Source/ImGui/Private/TextureManager.cpp +++ b/Source/ImGui/Private/TextureManager.cpp @@ -27,7 +27,7 @@ TextureIndex FTextureManager::CreatePlainTexture(const FName& Name, int32 Width, return CreatePlainTextureInternal(Name, Width, Height, Color); } -TextureIndex FTextureManager::CreateTextureResources(const FName& Name, UTexture2D* Texture) +TextureIndex FTextureManager::CreateTextureResources(const FName& Name, UTexture* Texture) { checkf(Name != NAME_None, TEXT("Trying to create texture resources with a name 'NAME_None' is not allowed.")); checkf(Texture, TEXT("Null Texture.")); @@ -87,7 +87,7 @@ TextureIndex FTextureManager::CreatePlainTextureInternal(const FName& Name, int3 return CreateTextureInternal(Name, Width, Height, Bpp, SrcData, SrcDataCleanup); } -TextureIndex FTextureManager::AddTextureEntry(const FName& Name, UTexture2D* Texture, bool bAddToRoot) +TextureIndex FTextureManager::AddTextureEntry(const FName& Name, UTexture* Texture, bool bAddToRoot) { // Try to find an entry with that name. TextureIndex Index = FindTextureIndex(Name); @@ -110,7 +110,7 @@ TextureIndex FTextureManager::AddTextureEntry(const FName& Name, UTexture2D* Tex } } -FTextureManager::FTextureEntry::FTextureEntry(const FName& InName, UTexture2D* InTexture, bool bAddToRoot) +FTextureManager::FTextureEntry::FTextureEntry(const FName& InName, UTexture* InTexture, bool bAddToRoot) : Name(InName) { checkf(InTexture, TEXT("Null texture.")); diff --git a/Source/ImGui/Private/TextureManager.h b/Source/ImGui/Private/TextureManager.h index 4456c79..960ffae 100644 --- a/Source/ImGui/Private/TextureManager.h +++ b/Source/ImGui/Private/TextureManager.h @@ -84,7 +84,7 @@ public: // @param Name - The texture name // @param Texture - The texture // @returns The index to created/updated texture resources - TextureIndex CreateTextureResources(const FName& Name, UTexture2D* Texture); + TextureIndex CreateTextureResources(const FName& Name, UTexture* Texture); // Release resources for given texture. Ignores invalid indices. // @param Index - The index of a texture resources @@ -107,7 +107,7 @@ private: // @param Texture - The texture // @param bAddToRoot - If true, we should add texture to root to prevent garbage collection (use for own textures) // @returns The index of the entry that we created or reused - TextureIndex AddTextureEntry(const FName& Name, UTexture2D* Texture, bool bAddToRoot); + TextureIndex AddTextureEntry(const FName& Name, UTexture* Texture, bool bAddToRoot); // Check whether index is in range allocated for TextureResources (it doesn't mean that resources are valid). FORCEINLINE bool IsInRange(TextureIndex Index) const @@ -125,7 +125,7 @@ private: struct FTextureEntry { FTextureEntry() = default; - FTextureEntry(const FName& InName, UTexture2D* InTexture, bool bAddToRoot); + FTextureEntry(const FName& InName, UTexture* InTexture, bool bAddToRoot); ~FTextureEntry(); // Copying is not supported. @@ -146,7 +146,7 @@ private: FName Name = NAME_None; mutable FSlateResourceHandle CachedResourceHandle; - TWeakObjectPtr Texture; + TWeakObjectPtr Texture; FSlateBrush Brush; }; diff --git a/Source/ImGui/Public/ImGuiModule.h b/Source/ImGui/Public/ImGuiModule.h index 8e63e60..247e187 100644 --- a/Source/ImGui/Public/ImGuiModule.h +++ b/Source/ImGui/Public/ImGuiModule.h @@ -108,7 +108,7 @@ public: * @returns Handle to the texture resources, which can be used to release allocated resources and as an argument to * relevant ImGui functions */ - virtual FImGuiTextureHandle RegisterTexture(const FName& Name, class UTexture2D* Texture, bool bMakeUnique = false); + virtual FImGuiTextureHandle RegisterTexture(const FName& Name, class UTexture* Texture, bool bMakeUnique = false); /** * Unregister texture and release its Slate resources. If handle is null or not valid, this function fails silently