Platform window enable/disable border support
This commit is contained in:
@@ -159,8 +159,7 @@ bool Win32Window::set_title(const std::wstring& title) {
|
||||
}
|
||||
|
||||
bool Win32Window::is_fullscreen() const {
|
||||
DWORD style = GetWindowLong(hwnd_, GWL_STYLE);
|
||||
return (style & WS_OVERLAPPEDWINDOW) != WS_OVERLAPPEDWINDOW;
|
||||
return fullscreen_;
|
||||
}
|
||||
|
||||
void Win32Window::ToggleFullscreen(bool fullscreen) {
|
||||
@@ -168,6 +167,8 @@ void Win32Window::ToggleFullscreen(bool fullscreen) {
|
||||
return;
|
||||
}
|
||||
|
||||
fullscreen_ = fullscreen;
|
||||
|
||||
DWORD style = GetWindowLong(hwnd_, GWL_STYLE);
|
||||
if (fullscreen) {
|
||||
// Kill our borders and resize to take up entire primary monitor.
|
||||
@@ -195,6 +196,25 @@ void Win32Window::ToggleFullscreen(bool fullscreen) {
|
||||
}
|
||||
}
|
||||
|
||||
bool Win32Window::is_bordered() const {
|
||||
DWORD style = GetWindowLong(hwnd_, GWL_STYLE);
|
||||
return (style & WS_OVERLAPPEDWINDOW) == WS_OVERLAPPEDWINDOW;
|
||||
}
|
||||
|
||||
void Win32Window::SetBordered(bool enabled) {
|
||||
if (is_fullscreen()) {
|
||||
// Don't screw with the borders if we're fullscreen.
|
||||
return;
|
||||
}
|
||||
|
||||
DWORD style = GetWindowLong(hwnd_, GWL_STYLE);
|
||||
if (enabled) {
|
||||
SetWindowLong(hwnd_, GWL_STYLE, style | WS_OVERLAPPEDWINDOW);
|
||||
} else {
|
||||
SetWindowLong(hwnd_, GWL_STYLE, style & ~WS_OVERLAPPEDWINDOW);
|
||||
}
|
||||
}
|
||||
|
||||
void Win32Window::set_cursor_visible(bool value) {
|
||||
if (is_cursor_visible_ == value) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user