Extra2D/examples/hello_world/main.cpp

28 lines
517 B
C++
Raw Permalink Normal View History

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