mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-03 10:55:57 -04:00
Implement more Window methods
This commit is contained in:
parent
dfaf8d0da3
commit
ecf9731750
@ -197,4 +197,20 @@ Window& Window::SetGrab(bool grabbed) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
int Window::GetDisplayIndex() const {
|
||||
int index = SDL_GetWindowDisplayIndex(window_);
|
||||
if (index < 0)
|
||||
throw SDL2pp::Exception("SDL_GetWindowDisplayIndex");
|
||||
return index;
|
||||
}
|
||||
|
||||
void Window::GetDisplayMode(SDL_DisplayMode& mode) const {
|
||||
if (SDL_GetWindowDisplayMode(window_, &mode) != 0)
|
||||
throw SDL2pp::Exception("SDL_GetWindowDisplayMode");
|
||||
}
|
||||
|
||||
Uint32 Window::GetFlags() const {
|
||||
return SDL_GetWindowFlags(window_);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <SDL2/SDL_stdinc.h>
|
||||
#include <SDL2/SDL_video.h>
|
||||
|
||||
#include <SDL2pp/Point.hh>
|
||||
|
||||
@ -441,6 +442,38 @@ public:
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
Window& SetGrab(bool grabbed);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the index of the display associated with a window
|
||||
///
|
||||
/// \returns Index of the display containing the center of the window
|
||||
///
|
||||
/// \see http://wiki.libsdl.org/SDL_GetWindowDisplayIndex
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
int GetDisplayIndex() const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get information about the display mode to use when a
|
||||
/// window is visible at fullscreen
|
||||
///
|
||||
/// \param[out] mode SDL_DisplayMode structure filled in with the
|
||||
/// fullscreen display mode
|
||||
///
|
||||
/// \see http://wiki.libsdl.org/SDL_GetWindowDisplayMode
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void GetDisplayMode(SDL_DisplayMode& mode) const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the window flags
|
||||
///
|
||||
/// \returns Mask of the SDL_WindowFlags associated with window
|
||||
///
|
||||
/// \see http://wiki.libsdl.org/SDL_GetWindowFlags
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
Uint32 GetFlags() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user