Fixed funcs for safe use in Win32/Win64

Signed-off-by: GermanAizek <GermanAizek@yandex.ru>
This commit is contained in:
Herman Semenov 2021-08-15 08:04:53 +03:00 committed by Lukas Dürrenberger
parent f4ac9cfb06
commit c90d308b45

View File

@ -343,7 +343,7 @@ void WindowImplWin32::setSize(const Vector2u& size)
// SetWindowPos wants the total size of the window (including title bar and borders), // SetWindowPos wants the total size of the window (including title bar and borders),
// so we have to compute it // so we have to compute it
RECT rectangle = {0, 0, static_cast<long>(size.x), static_cast<long>(size.y)}; RECT rectangle = {0, 0, static_cast<long>(size.x), static_cast<long>(size.y)};
AdjustWindowRect(&rectangle, GetWindowLong(m_handle, GWL_STYLE), false); AdjustWindowRect(&rectangle, GetWindowLongPtr(m_handle, GWL_STYLE), false);
int width = rectangle.right - rectangle.left; int width = rectangle.right - rectangle.left;
int height = rectangle.bottom - rectangle.top; int height = rectangle.bottom - rectangle.top;
@ -500,8 +500,8 @@ void WindowImplWin32::switchToFullscreen(const VideoMode& mode)
} }
// Make the window flags compatible with fullscreen mode // Make the window flags compatible with fullscreen mode
SetWindowLongW(m_handle, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); SetWindowLongPtr(m_handle, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
SetWindowLongW(m_handle, GWL_EXSTYLE, WS_EX_APPWINDOW); SetWindowLongPtr(m_handle, GWL_EXSTYLE, WS_EX_APPWINDOW);
// Resize the window so that it fits the entire screen // Resize the window so that it fits the entire screen
SetWindowPos(m_handle, HWND_TOP, 0, 0, mode.width, mode.height, SWP_FRAMECHANGED); SetWindowPos(m_handle, HWND_TOP, 0, 0, mode.width, mode.height, SWP_FRAMECHANGED);