Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
mnd::TextureManager Class Reference

Path-keyed cache that prevents the same image from being uploaded twice. More...

#include <Texture.h>

Public Member Functions

std::shared_ptr< TextureGetOrLoadTexture (const std::string &path)
 Return a cached texture, loading it from disk on first request.
 

Detailed Description

Path-keyed cache that prevents the same image from being uploaded twice.

Owned by the Engine singleton (Engine::GetTextureManager()). Material setup code should always go through this manager rather than Texture::Load() directly, so the same GL texture is reused across multiple materials.

Definition at line 93 of file Texture.h.

Member Function Documentation

◆ GetOrLoadTexture()

std::shared_ptr< Texture > mnd::TextureManager::GetOrLoadTexture ( const std::string &  path)

Return a cached texture, loading it from disk on first request.

Parameters
pathFilesystem path used as the cache key.
Returns
Shared pointer to the texture (never nullptr if the file exists).

Definition at line 58 of file Texture.cpp.

References mnd::Texture::Load().

Referenced by mnd::ParseGLTFNode().


The documentation for this class was generated from the following files: