diff options
| author | Rémi Verschelde | 2018-02-14 00:14:59 +0100 |
|---|---|---|
| committer | GitHub | 2018-02-14 00:14:59 +0100 |
| commit | 71ea00a358d430a110ae142ef548b5e720b622b0 (patch) | |
| tree | b7674b9f4f93f95fda5c536595e98f13d33d8ac5 /platform/windows/os_windows.cpp | |
| parent | ba106ae51c01c45ccca2c599357d4304482b78fb (diff) | |
| parent | ea1d726a4603fdd6bd4dfa6c1fa3128cfb2915c7 (diff) | |
| download | godot-71ea00a358d430a110ae142ef548b5e720b622b0.tar.gz godot-71ea00a358d430a110ae142ef548b5e720b622b0.tar.zst godot-71ea00a358d430a110ae142ef548b5e720b622b0.zip | |
Merge pull request #16648 from marcelofg55/center_window
Added OS::center_window to center the window precisely on desktop platforms
Diffstat (limited to '')
| -rw-r--r-- | platform/windows/os_windows.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index a2a51f10a..f4b20b698 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1487,6 +1487,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; |
