5#include <unordered_map>
71 template<TextureType Type>
~TextureHandleRegistry()=default
TypedTextureHandle< Type > getOrCreateHandle(const std::filesystem::path &path)
Get or create a typed handle for a texture path.
std::filesystem::path getPathForHandle(TextureHandle handle) const
Get the path associated with a handle (for debugging/validation)
uint32_t resolveDescriptorIndex(TextureHandle handle) const
Resolve a handle to its descriptor index (O(1) operation)
TextureHandleRegistry & operator=(const TextureHandleRegistry &)=delete
TextureHandle getOrCreateHandleImpl(const std::filesystem::path &path, TextureType type)
Internal implementation of getOrCreateHandle.
void clear()
Clear all registry entries (typically called on shutdown)
void onTextureLoaded(const std::filesystem::path &path, Texture *texture, uint32_t descriptorIndex)
Called when a texture finishes loading.
void onTextureUnloaded(const std::filesystem::path &path)
Called when a texture is unloaded.
TextureHandleRegistry(TextureHandleRegistry &&)=delete
std::unordered_map< std::string, uint32_t > pathToHandleId_
TextureType getTextureTypeForPath(const std::filesystem::path &path) const
Get the texture type for a path (if registered)
TextureHandleRegistry()=default
size_t getHandleCount() const
Get the total number of registered texture handles.
TextureHandleRegistry(const TextureHandleRegistry &)=delete
TextureHandleRegistry & operator=(TextureHandleRegistry &&)=delete
TextureType getTextureType(TextureHandle handle) const
Get the texture type for a handle.
std::vector< Entry > entries_
Type-erased texture handle for runtime storage.
static constexpr uint32_t INVALID_ID
Type-safe texture handle wrapper providing compile-time type safety.
Log category system implementation.
TextureType
Represents the semantic type of a texture, determining its Vulkan format.
@ Unknown
Fallback type, uses SRGB as default.
Registry entry storing texture metadata.
std::filesystem::path path