diff options
author | Marcelo Fernandez <marcelofg55@gmail.com> | 2018-02-12 14:17:29 -0300 |
---|---|---|
committer | Marcelo Fernandez <marcelofg55@gmail.com> | 2018-02-12 15:45:41 -0300 |
commit | ea1d726a4603fdd6bd4dfa6c1fa3128cfb2915c7 (patch) | |
tree | 109889d417d20c47442d9bcae765fb7f0703018d /platform/windows | |
parent | f961ba004b1d67cbc0835202930fa8d16b8ff07a (diff) |
Added OS::center_window to center the window precisely on desktop platforms
Diffstat (limited to 'platform/windows')
-rw-r--r-- | platform/windows/os_windows.cpp | 6 | ||||
-rw-r--r-- | platform/windows/os_windows.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index a2a51f10a7..f4b20b6981 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; diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 7308650695..543abe147d 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -201,6 +201,7 @@ public: virtual Point2 get_window_position() const; virtual void set_window_position(const Point2 &p_position); virtual Size2 get_window_size() const; + virtual Size2 get_real_window_size() const; virtual void set_window_size(const Size2 p_size); virtual void set_window_fullscreen(bool p_enabled); virtual bool is_window_fullscreen() const; |