Better scene management.

This commit is contained in:
2025-01-02 12:57:21 -05:00
parent b9afc57e6e
commit 30bdd66086
13 changed files with 78 additions and 47 deletions

View File

@@ -1,12 +1,18 @@
#include "Engine/Globals.h"
#include <Engine/Level/Scene.h>
#include <Engine/Globals.h>
#include <rewindow/logger/logger.h>
#include "Game/Scene/Splash.h"
Scene* scene = nullptr;
#include <Game/Scene/ControllableBox.h>
#include <Game/Scene/Loading.h>
using namespace JGL;
void CreateScenes() {
auto ld = new LoadingScreen("LoadingScreen");
Globals::SceneList.push_back(ld);
auto cb = new ControllableBox("Scene0");
Globals::SceneList.push_back(cb);
};
int main() {
Globals::Window = new DemoGameWindow("Demo Game", 1024, 896);
Globals::Window->SetRenderer(RenderingAPI::OPENGL);
@@ -18,8 +24,8 @@ int main() {
ReWindow::Logger::Warning.EnableConsole(false);
ReWindow::Logger::Debug.EnableConsole(false);
auto* splash = new DemoGameSplash();
Globals::ChangeScene(splash);
CreateScenes();
Globals::ChangeScene("LoadingScreen");
while (Globals::Window->IsAlive())
Globals::Window->ManagedRefresh();