Applying better design choices for general engine

Renderer is causing a big memory leak because it never deletes its Vertex Array
This commit is contained in:
2022-11-12 22:40:36 +01:00
parent 4b84707f98
commit a1ec94e983
19 changed files with 626 additions and 635 deletions

View File

@ -20,7 +20,7 @@ void Project::SaveProject(std::filesystem::path path, Project& project)
projectFile.close();
}
void Project::LoadProject(std::filesystem::path path, std::shared_ptr<Project>& project)
void Project::LoadProject(std::filesystem::path path, std::unique_ptr<Project>& project)
{
std::string YAMLProject;
std::stringstream sstream;
@ -36,8 +36,8 @@ void Project::LoadProject(std::filesystem::path path, std::shared_ptr<Project>&
YAML::Node node = YAML::Load(YAMLProject);
// this is probably not perfect but it seems to work for now
project.reset();
project = std::make_shared<Project>(node.as<Project>());
project.release();
project = std::make_unique<Project>(node.as<Project>());
std::cout << "loading..." << project.get()->Name << std::endl;