2021-05-03 14:05:29 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreTypes.h"
|
|
|
|
|
#include "Interfaces/ITextureFormatManagerModule.h"
|
2021-05-17 12:32:02 -04:00
|
|
|
#include "Modules/ModuleManager.h"
|
2021-05-03 14:05:29 -04:00
|
|
|
|
|
|
|
|
/** Return the Texture Format Manager interface, if it is available, otherwise return nullptr. **/
|
2021-05-14 18:38:47 -04:00
|
|
|
inline ITextureFormatManagerModule* GetTextureFormatManager()
|
|
|
|
|
{
|
|
|
|
|
return FModuleManager::LoadModulePtr<ITextureFormatManagerModule>("TextureFormat");
|
|
|
|
|
}
|
2021-05-03 14:05:29 -04:00
|
|
|
|
|
|
|
|
/** Return the Texture Format Manager interface, fatal error if it is not available. **/
|
2021-05-14 18:38:47 -04:00
|
|
|
inline ITextureFormatManagerModule& GetTextureFormatManagerRef()
|
|
|
|
|
{
|
|
|
|
|
class ITextureFormatManagerModule* TextureFormatManager = GetTextureFormatManager();
|
|
|
|
|
if (!TextureFormatManager)
|
|
|
|
|
{
|
|
|
|
|
UE_LOG(LogInit, Fatal, TEXT("Texture format manager was requested, but not available."));
|
|
|
|
|
CA_ASSUME( TextureFormatManager != NULL ); // Suppress static analysis warning in unreachable code (fatal error)
|
|
|
|
|
}
|
|
|
|
|
return *TextureFormatManager;
|
|
|
|
|
}
|
|
|
|
|
|