mirror of
https://github.com/zhenyan121/SporeBG-Conid.git
synced 2026-04-10 14:24:10 +08:00
change the location of initSDL
This commit is contained in:
@@ -9,6 +9,12 @@ GameApplication::~GameApplication() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool GameApplication::initialize() {
|
bool GameApplication::initialize() {
|
||||||
|
// 初始化SDL视频子系统[6,7](@ref)
|
||||||
|
if (!SDL_Init(SDL_INIT_VIDEO)) {
|
||||||
|
SDL_Log("SDL初始化失败: %s", SDL_GetError());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
m_inputManager = std::make_unique<InputManager>();
|
m_inputManager = std::make_unique<InputManager>();
|
||||||
m_windowManager = std::make_unique<WindowManager>();
|
m_windowManager = std::make_unique<WindowManager>();
|
||||||
|
|
||||||
|
|||||||
@@ -17,11 +17,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[]) {
|
|||||||
// 设置应用元数据[8](@ref)
|
// 设置应用元数据[8](@ref)
|
||||||
SDL_SetAppMetadata("孢子棋", "1.0.0", "com.zhenyan121.sporebgconid");
|
SDL_SetAppMetadata("孢子棋", "1.0.0", "com.zhenyan121.sporebgconid");
|
||||||
|
|
||||||
// 初始化SDL视频子系统[6,7](@ref)
|
|
||||||
if (!SDL_Init(SDL_INIT_VIDEO)) {
|
|
||||||
SDL_Log("SDL初始化失败: %s", SDL_GetError());
|
|
||||||
return SDL_APP_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 创建游戏实例
|
// 创建游戏实例
|
||||||
auto gameapp = new GameApplication();
|
auto gameapp = new GameApplication();
|
||||||
|
|||||||
Reference in New Issue
Block a user