mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-03 10:55:57 -04:00
Merge 6fe57dec0d8c5845b03cc86fb9931840dd6e2293 into b00d3b9eb98be4fa2eca7ae9d88f96d28796e4f0
This commit is contained in:
commit
334c333a98
@ -142,6 +142,14 @@ Window& Window::SetFullscreen(Uint32 flags) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
Window& Window::ToggleFullscreen() {
|
||||
Uint32 const fullscreenFlag = SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||
bool const isFullscreen = SDL_GetWindowFlags(window_) & fullscreenFlag;
|
||||
if (SDL_SetWindowFullscreen(window_, isFullscreen ? SDL_FALSE : SDL_WINDOW_FULLSCREEN_DESKTOP) != 0)
|
||||
throw Exception("SDL_SetWindowFullscreen");
|
||||
return *this;
|
||||
}
|
||||
|
||||
Window& Window::SetSize(int w, int h) {
|
||||
SDL_SetWindowSize(window_, w, h);
|
||||
return *this;
|
||||
|
@ -302,6 +302,18 @@ public:
|
||||
////////////////////////////////////////////////////////////
|
||||
Window& SetFullscreen(Uint32 flags);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Toggle the window's fullscreen state
|
||||
///
|
||||
/// \returns Reference to self
|
||||
///
|
||||
/// \throws SDL2pp::Exception
|
||||
///
|
||||
/// \see http://wiki.libsdl.org/SDL_SetWindowFullscreen
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
Window& ToggleFullscreen();
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the size of a window's client area
|
||||
///
|
||||
|
Loading…
x
Reference in New Issue
Block a user