2025-05-15 20:33:20 +08:00
|
|
|
#include "engine/core/game_app.h"
|
2025-06-21 10:52:11 +08:00
|
|
|
#include "engine/scene/scene_manager.h"
|
|
|
|
|
#include "game/scene/title_scene.h"
|
2025-05-19 16:22:09 +08:00
|
|
|
#include <spdlog/spdlog.h>
|
2025-06-22 15:10:09 +08:00
|
|
|
#include <SDL3/SDL_main.h>
|
2025-05-15 20:33:20 +08:00
|
|
|
|
2025-06-21 10:52:11 +08:00
|
|
|
void setupInitialScene(engine::scene::SceneManager& scene_manager) {
|
|
|
|
|
// GameApp在调用run方法之前,先创建并设置初始场景
|
|
|
|
|
auto title_scene = std::make_unique<game::scene::TitleScene>(scene_manager.getContext(), scene_manager);
|
|
|
|
|
scene_manager.requestPushScene(std::move(title_scene));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2025-05-15 20:33:20 +08:00
|
|
|
int main(int /* argc */, char* /* argv */[]) {
|
2025-06-16 10:42:56 +08:00
|
|
|
spdlog::set_level(spdlog::level::off);
|
2025-05-19 16:22:09 +08:00
|
|
|
|
2025-05-15 20:33:20 +08:00
|
|
|
engine::core::GameApp app;
|
2025-06-21 10:52:11 +08:00
|
|
|
app.registerSceneSetup(setupInitialScene);
|
2025-05-15 20:33:20 +08:00
|
|
|
app.run();
|
|
|
|
|
return 0;
|
|
|
|
|
}
|