1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

Added OS::center_window to center the window precisely on desktop platforms

This commit is contained in:
marcelofg55
2017-12-02 16:48:14 -03:00
committed by Marcelo Fernandez
parent 7983fb95b0
commit 129e0f34d0
10 changed files with 62 additions and 1 deletions

View File

@@ -1486,6 +1486,12 @@ Size2 OS_Windows::get_window_size() const {
GetClientRect(hWnd, &r);
return Vector2(r.right - r.left, r.bottom - r.top);
}
Size2 OS_Windows::get_real_window_size() const {
RECT r;
GetWindowRect(hWnd, &r);
return Vector2(r.right - r.left, r.bottom - r.top);
}
void OS_Windows::set_window_size(const Size2 p_size) {
video_mode.width = p_size.width;