refactor(application): 将SquirrelVM执行逻辑改为启动回调

修改Application::run方法,接收一个启动回调函数参数,将原本直接执行的SquirrelVM::run逻辑改为由调用方通过回调控制。同时更新相关文档说明这一变更。
This commit is contained in:
2026-04-01 05:27:55 +08:00
parent 8cb688cf27
commit 648b94e741
4 changed files with 22 additions and 14 deletions

View File

@@ -230,7 +230,11 @@ int main(int argc, char **argv) {
// SDL_Log("File: %s", path.c_str());
// }
app.run();
app.run([]() {
if (SquirrelVM::get().isInitialized()) {
SquirrelVM::get().run();
}
});
SDL_Log("Application exited normally");
app.shutdown();