10#include <unordered_map>
93 std::string
UploadTextureToRAM(std::string textureFileName, std::vector<uint8_t>
const& fileBytes);
167 std::unordered_map<std::string, std::shared_ptr<ImageDataGpu>>
mTextures;
Defines an abstract interface for rendering backends.
Interface for observing renderer resource lifecycle events.
Interface for backend-specific GPU texture resource management.
Combines CPU-side and GPU-side texture representations, managing both lifetimes and transitions.
void OnRenderResourcesRelease() override
Renderer callback: release all GPU resources (used during device loss/reset).
std::unordered_map< std::string, std::shared_ptr< ImageDataGpu > > mTextures
void LoadTexturesFromPackage()
Loads all textures from the packed asset archive.
void ReleaseAll()
Fully clears the texture cache, including both RAM and GPU resources.
void OnRenderResourcesRebuild() override
Renderer callback: re-upload or recreate all GPU resources (used after device reset/rebuild).
std::shared_ptr< ImageDataGpu > GetTextureResources(std::string filename)
Retrieves the full texture resource wrapper from cache.
void ReleaseAllFromGPU()
Releases all cached textures from GPU memory.
std::string UploadTextureToRAM(std::string path)
Loads a single texture into RAM from the given file path.
ITextureRenderResources * GetTextureRenderResources(std::string filename)
Retrieves only the GPU render resources of a cached texture.
size_t GetSizeInRAM() const
Gets the total size of all currently cached textures in RAM.
void UploadTextureToGPU(std::string filename)
Uploads a texture (previously loaded into RAM) to GPU.
void LoadTexturesFromFolder(std::string pathToFolder)
Loads all supported texture files (*.jpg, *.png) from a specified folder into RAM and uploads them to...
TextureCache(IRenderer *renderer)
Constructs the TextureCache with a reference to the renderer.
size_t GetSizeInGPU() const
Gets the total size of all textures currently uploaded to GPU.
void ReleaseTextureFromGPU(std::string filename)
Releases a texture from GPU memory.