diff options
author | Ryan C. Gordon <icculus@icculus.org> | 2016-01-04 23:52:40 -0500 |
---|---|---|
committer | Ryan C. Gordon <icculus@icculus.org> | 2016-01-04 23:52:40 -0500 |
commit | 237d49ed2ef82ec93d19c593290052322f58f222 (patch) | |
tree | 6a1d9e399489c21dd9e48f16118b6c695256175d /src/video/SDL_video.c | |
parent | c2b2f00eebd01f875309af70ac733494bd9f1611 (diff) | |
download | sdl-237d49ed2ef82ec93d19c593290052322f58f222.tar.gz |
Added SDL_GetDisplayUsableBounds().
Diffstat (limited to 'src/video/SDL_video.c')
-rw-r--r-- | src/video/SDL_video.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 511b4c087..300abea57 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -684,7 +684,26 @@ SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect) rect->w = display->current_mode.w; rect->h = display->current_mode.h; } - return 0; + return 0; /* !!! FIXME: should this be an error if (rect==NULL) ? */ +} + +int SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect * rect) +{ + CHECK_DISPLAY_INDEX(displayIndex, -1); + + if (rect) { + SDL_VideoDisplay *display = &_this->displays[displayIndex]; + + if (_this->GetDisplayUsableBounds) { + if (_this->GetDisplayUsableBounds(_this, display, rect) == 0) { + return 0; + } + } + + /* Oh well, just give the entire display bounds. */ + return SDL_GetDisplayBounds(displayIndex, rect); + } + return 0; /* !!! FIXME: should this be an error if (rect==NULL) ? */ } int |