mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-03 19:05:59 -04:00
Added GetDisplayBounds
This commit is contained in:
parent
5068355832
commit
9986e488e9
@ -28,6 +28,15 @@
|
||||
using std::string;
|
||||
|
||||
namespace SDL2pp {
|
||||
Rect GetDisplayBounds(int displayIndex) {
|
||||
Rect result;
|
||||
if (SDL_GetDisplayBounds(displayIndex, &result) < 0) {
|
||||
throw Exception("SDL_GetDisplayBounds");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
string GetDisplayName(int displayIndex) {
|
||||
const char* name = SDL_GetDisplayName(displayIndex);
|
||||
if (name == nullptr) {
|
||||
|
@ -30,6 +30,29 @@
|
||||
#include <string>
|
||||
|
||||
namespace SDL2pp {
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Gets the area of a given display
|
||||
///
|
||||
/// This function retrieves an rectangle with the area of
|
||||
/// the given display, with the initial display being located
|
||||
/// at (0,0). This function does not takes into account space
|
||||
/// that is not usable, like OS X's menu bar.
|
||||
///
|
||||
/// \ingroup graphics
|
||||
///
|
||||
/// \headerfile SDL2pp/Display.hh
|
||||
///
|
||||
/// \param[in] displayIndex The display to retrieve the area
|
||||
///
|
||||
/// \returns A rectangle with area of the given display
|
||||
///
|
||||
/// \throws SDL2pp::Exception
|
||||
///
|
||||
/// \see https://wiki.libsdl.org/SDL_GetDisplayBounds
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
SDL2PP_EXPORT Rect GetDisplayBounds(int displayIndex);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Gets the name of a given display
|
||||
///
|
||||
|
Loading…
x
Reference in New Issue
Block a user