feat(窗口): 实现窗口大小和位置调整功能
添加窗口大小和位置调整的回调处理,支持通过按键触发窗口尺寸和位置变化 完善Window类的setSize、setPos和pos方法实现,添加SDL窗口操作
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user