Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fix behavior of SDL_GetWindowPosition for invalid input; add test cas…
Browse files Browse the repository at this point in the history
…es to video suite
  • Loading branch information
ferzkopp committed Mar 4, 2013
1 parent bbe13d4 commit fb9dbf9
Show file tree
Hide file tree
Showing 2 changed files with 435 additions and 46 deletions.
14 changes: 6 additions & 8 deletions src/video/SDL_video.c
Expand Up @@ -1524,18 +1524,16 @@ SDL_SetWindowPosition(SDL_Window * window, int x, int y)
void
SDL_GetWindowPosition(SDL_Window * window, int *x, int *y)
{
/* Clear the values */
if (x) {
*x = 0;
}
if (y) {
*y = 0;
}

CHECK_WINDOW_MAGIC(window, );

/* Fullscreen windows are always at their display's origin */
if (window->flags & SDL_WINDOW_FULLSCREEN) {
if (x) {
*x = 0;
}
if (y) {
*y = 0;
}
} else {
if (x) {
*x = window->x;
Expand Down

0 comments on commit fb9dbf9

Please sign in to comment.