|
|
@@ -34,6 +34,15 @@ namespace engine {
|
|
|
|
|
|
game_dispatch::~game_dispatch() {}
|
|
|
|
|
|
+ void game_dispatch::register_scene(scene_t scn) {
|
|
|
+ scenes.emplace(scn->id, scn);
|
|
|
+ }
|
|
|
+
|
|
|
+ void game_dispatch::activate_scene(scene_id_t const & id) {
|
|
|
+ // TODO: Cleanup
|
|
|
+ curr_scene = current_scene_info(scenes[id].get());
|
|
|
+ }
|
|
|
+
|
|
|
game_dispatch::current_scene_info::current_scene_info() {}
|
|
|
|
|
|
game_dispatch::current_scene_info::current_scene_info(scene * curr)
|
|
|
@@ -77,7 +86,7 @@ namespace engine {
|
|
|
void game_dispatch::update() {
|
|
|
env::clock::tick t = next_frame();
|
|
|
counter->set_frame_step(t.since);
|
|
|
- // curr_scene.ptr->update(std::chrono::duration<float>(t.since).count());
|
|
|
+ curr_scene.ptr->update(std::chrono::duration<float>(t.since).count());
|
|
|
}
|
|
|
|
|
|
void game_dispatch::render() {
|
|
|
@@ -86,6 +95,6 @@ namespace engine {
|
|
|
for (auto & obj : counter->glyphs()) {
|
|
|
batch.draw(obj);
|
|
|
}
|
|
|
- // curr_scene.ptr->render(batch);
|
|
|
+ curr_scene.ptr->render(batch);
|
|
|
}
|
|
|
}
|