Claire's Game Engine
Full C++ Engine using OpenGL
Loading...
Searching...
No Matches
AssetManager Class Reference

AssetManager is a static utility class responsible for loading, caching, and managing textures and meshes across the application. More...

#include <AssetManager.h>

Public Member Functions

 AssetManager (const AssetManager &)=delete
 
AssetManageroperator= (const AssetManager &)=delete
 

Static Public Member Functions

static TextureLoadTexture (IRenderer &pRenderer, const std::string &pFileName, const std::string &pName)
 Loads a texture from file and stores it with a given name.
 
static void LoadTexturesFromFolder (IRenderer &pRenderer, const std::string &pPathName, std::vector< Texture * > &pAllTextures)
 Loads all textures from a given folder path.
 
static TextureGetTexture (const std::string &pName)
 Retrieves a previously loaded texture by name.
 
static MeshLoadMesh (const std::string &pFileName, const std::string &pName)
 Loads a 3D mesh from an .obj file and stores it with a given name.
 
static MeshGetMesh (const std::string &pName)
 Retrieves a previously loaded mesh by name.
 
static void Clear ()
 Frees all loaded assets (textures and meshes).
 

Detailed Description

AssetManager is a static utility class responsible for loading, caching, and managing textures and meshes across the application.

Constructor & Destructor Documentation

◆ AssetManager()

AssetManager::AssetManager ( const AssetManager & )
delete

Member Function Documentation

◆ Clear()

void AssetManager::Clear ( )
static

Frees all loaded assets (textures and meshes).

◆ GetMesh()

Mesh * AssetManager::GetMesh ( const std::string & pName)
static

Retrieves a previously loaded mesh by name.

Parameters
pNameName associated with the mesh.
Returns
Pointer to the Mesh or nullptr if not found.

◆ GetTexture()

Texture * AssetManager::GetTexture ( const std::string & pName)
static

Retrieves a previously loaded texture by name.

Parameters
pNameName associated with the texture.
Returns
Pointer to the Texture or nullptr if not found.

◆ LoadMesh()

Mesh * AssetManager::LoadMesh ( const std::string & pFileName,
const std::string & pName )
static

Loads a 3D mesh from an .obj file and stores it with a given name.

Parameters
pFileName.obj mesh filename (relative to mesh directory).
pNameName to associate with the mesh.
Returns
Pointer to the loaded Mesh.

◆ LoadTexture()

Texture * AssetManager::LoadTexture ( IRenderer & pRenderer,
const std::string & pFileName,
const std::string & pName )
static

Loads a texture from file and stores it with a given name.

Parameters
pRendererThe rendering backend.
pFileNamePath to the texture file.
pNameName to associate with the texture.
Returns
Pointer to the loaded Texture.

◆ LoadTexturesFromFolder()

void AssetManager::LoadTexturesFromFolder ( IRenderer & pRenderer,
const std::string & pPathName,
std::vector< Texture * > & pAllTextures )
static

Loads all textures from a given folder path.

Parameters
pRendererThe rendering backend.
pPathNameFolder path containing texture files.
pAllTexturesOutput vector filled with loaded textures.

◆ operator=()

AssetManager & AssetManager::operator= ( const AssetManager & )
delete

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