From 0aa97807cb9b7f1d1850449dd5a5e45b961445ce Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 13 Nov 2024 18:46:06 +0100 Subject: fix scene_manager example --- src/crepe/api/SceneManager.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/crepe/api/SceneManager.hpp') diff --git a/src/crepe/api/SceneManager.hpp b/src/crepe/api/SceneManager.hpp index 8bad7b2..714f690 100644 --- a/src/crepe/api/SceneManager.hpp +++ b/src/crepe/api/SceneManager.hpp @@ -1,13 +1,16 @@ +#pragma once + #include "SceneManager.h" namespace crepe { template void SceneManager::add_scene(const std::string & name) { - static_assert(std::is_base_of::value, - "T must be derived from Scene"); + using namespace std; + static_assert(is_base_of::value, "T must be derived from Scene"); - scenes.emplace_back(make_unique(name)); + Scene * scene = new T(this->component_manager, name); + this->scenes.emplace_back(unique_ptr(scene)); // The first scene added, is the one that will be loaded at the beginning if (next_scene.empty()) { -- cgit v1.2.3