blob: e2ba2da5c7cebbbb0c15f14a90aa94c66a6bb96b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#include "SceneManager.h"
namespace crepe {
// Add a new concrete scene to the scene manager
template <typename T>
void SceneManager::add_scene(const std::string & name) {
static_assert(std::is_base_of<Scene, T>::value,
"T must be derived from Scene");
scenes.emplace_back(make_unique<T>(name));
// The first scene added, is the one that will be loaded at the beginning
if (next_scene.empty()) {
next_scene = name;
}
}
} // namespace crepe
|