Testing some event stuff

This commit is contained in:
2023-11-17 22:40:08 -06:00
parent 0c46c328fa
commit 26b5ec2c7f
20 changed files with 260 additions and 30 deletions

View File

@ -22,14 +22,15 @@ void Game::init() {
}
void Game::update() {
timeManager.update();
renderHost.update(shared_from_this());
if(nextFrameScene) {
nextFrameScene->stage();
currentScene = nextFrameScene;
nextFrameScene = nullptr;
}
timeManager.update();
if(currentScene) currentScene->update();
renderHost.update(shared_from_this());
}
bool_t Game::isCloseRequested() {

View File

@ -14,8 +14,8 @@ namespace Dawn {
class Game : public std::enable_shared_from_this<Game> {
private:
std::shared_ptr<Scene> currentScene;
std::shared_ptr<Scene> nextFrameScene;
std::shared_ptr<Scene> currentScene = nullptr;
std::shared_ptr<Scene> nextFrameScene = nullptr;
public:
RenderHost renderHost;