Rework API graphique Vulkan - EnTT pour ECS + Chargement modèle 3D assimp + SDL3 pour events input et fenetre + mesh texture camera transform ok + attention tous les assets nouveaus ne sont pas commités et il y a du code test en dur dans scene addentity + restructuration globale
This commit is contained in:
32
src/Engine/Core/Graphics/Data/CModelManager.hpp
Normal file
32
src/Engine/Core/Graphics/Data/CModelManager.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef CMODELMANAGER_HPP
|
||||
#define CMODELMANAGER_HPP
|
||||
|
||||
#include "CModel.hpp"
|
||||
#include <list>
|
||||
#include <memory>
|
||||
class CModelManager
|
||||
{
|
||||
public:
|
||||
std::list<std::unique_ptr<CModel>> loadedModel;
|
||||
std::unordered_map<std::string, CModel*> modelsMap;
|
||||
|
||||
void addModel(std::string name, std::unique_ptr<CModel>&& model)
|
||||
{
|
||||
loadedModel.push_back(std::move(model));
|
||||
modelsMap[name] = loadedModel.back().get();
|
||||
}
|
||||
std::optional<CModel*> get(std::string name)
|
||||
{
|
||||
auto find = modelsMap.find(name);
|
||||
if(find != modelsMap.end())
|
||||
{
|
||||
return find->second;
|
||||
}
|
||||
else {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user