about to add SDL and probably break everything

This commit is contained in:
2023-01-16 10:01:06 -08:00
parent dbe2409287
commit 23fc1206ba
54 changed files with 904 additions and 138 deletions

View File

@ -4,7 +4,11 @@
// https://opensource.org/licenses/MIT
#include "DawnGame.hpp"
#include "scenes/SubsceneTest.hpp"
#include "scenes/SubSceneRendererScene.hpp"
#include "scenes/Scene_1.hpp"
#include <thread>
#include <chrono>
using namespace Dawn;
@ -22,12 +26,23 @@ int32_t DawnGame::init() {
this->localeManager.init();
this->renderManager.init();
this->scene = new SubsceneTest(this);
this->scene = new SubSceneRendererScene<Scene_4>(this);
return DAWN_GAME_INIT_RESULT_SUCCESS;
}
int32_t DawnGame::update(float_t delta) {
if(this->sceneToCutTo != nullptr) {
if(this->sceneToCutTo == this->scene) {
delete this->scene;
this->scene = nullptr;
} else {
delete this->scene;
this->scene = this->sceneToCutTo;
}
this->sceneToCutTo = nullptr;
}
this->assetManager.update();
this->inputManager.update();
this->timeManager.update(delta);
@ -37,4 +52,10 @@ int32_t DawnGame::update(float_t delta) {
this->renderManager.update();
return DAWN_GAME_UPDATE_RESULT_SUCCESS;
}
void DawnGame::sceneCutover(Scene *scene) {
if(scene == nullptr) scene = this->scene;
this->sceneToCutTo = scene;
}