feat(窗口): 实现窗口大小和位置调整功能

添加窗口大小和位置调整的回调处理,支持通过按键触发窗口尺寸和位置变化
完善Window类的setSize、setPos和pos方法实现,添加SDL窗口操作
This commit is contained in:
2026-03-29 12:33:10 +08:00
parent dc41475b87
commit d97b4e69b9
3 changed files with 37 additions and 2 deletions

View File

@@ -100,6 +100,18 @@ int main(int argc, char **argv) {
if(ke.getButton() == 6) {
Application::get().quit();
}
if (ke.getButton() == 0) {
Application::get().getWindow()->setPos(0, 0);
SDL_Log("setPos ret=%d, %d", Application::get().getWindow()->pos().x, Application::get().getWindow()->pos().y);
Application::get().getWindow()->setSize(1920, 1080);
}
if (ke.getButton() == 1) {
Application::get().getWindow()->setPos(0, 0);
Application::get().getWindow()->setSize(1280, 720);
}
return true;
});