2026-02-25 06:23:53 +08:00
|
|
|
#include <extra2d.h>
|
2026-02-28 22:30:48 +08:00
|
|
|
#include <cstdio>
|
2026-02-11 19:40:26 +08:00
|
|
|
|
|
|
|
|
using namespace extra2d;
|
|
|
|
|
|
2026-02-13 16:52:57 +08:00
|
|
|
int main(int argc, char **argv) {
|
2026-02-28 22:30:48 +08:00
|
|
|
// 创建应用(自动创建窗口)
|
|
|
|
|
auto app = Application::create();
|
|
|
|
|
|
2026-02-11 19:40:26 +08:00
|
|
|
AppConfig config;
|
2026-02-28 22:30:48 +08:00
|
|
|
config.title = "Hello World";
|
2026-02-11 19:40:26 +08:00
|
|
|
config.width = 1280;
|
|
|
|
|
config.height = 720;
|
2026-02-28 22:30:48 +08:00
|
|
|
|
|
|
|
|
if (!app->init(config)) {
|
|
|
|
|
printf("Failed to initialize!\n");
|
2026-02-11 19:40:26 +08:00
|
|
|
return -1;
|
|
|
|
|
}
|
2026-02-28 22:30:48 +08:00
|
|
|
|
|
|
|
|
printf("Window: %dx%d\n", app->getWindowWidth(), app->getWindowHeight());
|
|
|
|
|
|
2026-02-11 19:40:26 +08:00
|
|
|
// 运行应用
|
2026-02-28 22:30:48 +08:00
|
|
|
app->run();
|
|
|
|
|
|
|
|
|
|
// 自动销毁
|
2026-02-11 19:40:26 +08:00
|
|
|
return 0;
|
|
|
|
|
}
|