Files
simian/include/ModelManager.h
T
2026-03-06 14:32:25 +13:00

35 lines
730 B
C++

#pragma once
#include "raylib.h"
#include <unordered_map>
#include <string>
class ModelManager
{
public:
ModelManager();
~ModelManager();
// Load a model from a file
// Returns a unique ID for the model, or 0 on failure
unsigned int Load(const std::string& path);
// Load a model from a mesh
// Returns a unique ID for the model, or 0 on failure
unsigned int LoadFromMesh(Mesh mesh);
// Unload a model by ID
void Unload(unsigned int id);
// Get a model by ID (returns nullptr if not found)
Model* Get(unsigned int id);
// Unload all models
void UnloadAll();
private:
std::unordered_map<unsigned int, Model> models;
unsigned int nextId;
bool unloaded;
};