Manages loading and caching of game assets (meshes, materials, shaders).
More...
#include <asset_manager.hpp>
|
| void | generateSphere (std::vector< float > &vertices, std::vector< uint32_t > &indices, float radius=1.0f, int resolution=100) |
| | Generate sphere mesh geometry.
|
| void | generateGrid (std::vector< float > &vertices, std::vector< uint32_t > &indices, float spacing=20.0f, int extent=100) |
| | Generate grid mesh geometry.
|
| | AssetManager () |
| | ~AssetManager () |
Manages loading and caching of game assets (meshes, materials, shaders).
- Note
- Singleton pattern with lazy loading and caching
- Warning
- All asset loading requires active OpenGL context
◆ AssetManager() [1/2]
| solarsim::AssetManager::AssetManager |
( |
const AssetManager & | | ) |
|
|
delete |
◆ AssetManager() [2/2]
| solarsim::AssetManager::AssetManager |
( |
| ) |
|
|
inlineprivate |
◆ ~AssetManager()
| solarsim::AssetManager::~AssetManager |
( |
| ) |
|
|
inlineprivate |
◆ generateGrid()
| void solarsim::AssetManager::generateGrid |
( |
std::vector< float > & | vertices, |
|
|
std::vector< uint32_t > & | indices, |
|
|
float | spacing = 20.0f, |
|
|
int | extent = 100 ) |
|
private |
Generate grid mesh geometry.
- Parameters
-
| vertices | Output vector for vertex data |
| indices | Output vector for index data |
| spacing | Distance between grid lines |
| extent | Number of lines in each direction from center |
◆ generateSphere()
| void solarsim::AssetManager::generateSphere |
( |
std::vector< float > & | vertices, |
|
|
std::vector< uint32_t > & | indices, |
|
|
float | radius = 1.0f, |
|
|
int | resolution = 100 ) |
|
private |
Generate sphere mesh geometry.
- Parameters
-
| vertices | Output vector for vertex data |
| indices | Output vector for index data |
| radius | Sphere radius |
| resolution | Tessellation resolution |
◆ get()
◆ LoadMaterial()
| std::shared_ptr< Material > solarsim::AssetManager::LoadMaterial |
( |
const std::string & | materialID | ) |
|
Load or retrieve a cached material by ID.
- Parameters
-
| materialID | Unique identifier for the material |
- Returns
- std::shared_ptr<Material> Shared pointer to the material
- Note
- Currently supports predefined materials only
- Warning
- Undefined behavior if materialID is not recognized as of now
◆ LoadMesh()
| std::shared_ptr< Mesh > solarsim::AssetManager::LoadMesh |
( |
const std::string & | meshID | ) |
|
Load or retrieve a cached mesh by ID.
- Parameters
-
| meshID | Unique identifier for the mesh |
- Returns
- std::shared_ptr<Mesh> Shared pointer to the mesh
- Note
- Currently supports predefined shapes: "cube", "sphere", "grid"
- Warning
- Undefined behavior if meshID is not recognized as of now
◆ LoadShader()
| std::shared_ptr< Shader > solarsim::AssetManager::LoadShader |
( |
const std::string & | shaderID | ) |
|
Load or retrieve a cached shader by ID.
- Parameters
-
| shaderID | Unique identifier for the shader |
- Returns
- std::shared_ptr<Shader> Shared pointer to the shader
- Note
- Currently supports predefined shaders only
- Warning
- Undefined behavior if shaderID is not recognized as of now
◆ operator=()
◆ loadedMaterials
| std::unordered_map<std::string, std::shared_ptr<Material> > solarsim::AssetManager::loadedMaterials |
|
private |
Cache of loaded materials
◆ loadedMeshes
| std::unordered_map<std::string, std::shared_ptr<Mesh> > solarsim::AssetManager::loadedMeshes |
|
private |
◆ loadedShaders
| std::unordered_map<std::string, std::shared_ptr<Shader> > solarsim::AssetManager::loadedShaders |
|
private |
Cache of loaded shader shaders
The documentation for this class was generated from the following files: