Commit c4f308a1 authored by Sam Lantinga's avatar Sam Lantinga

Better window parameter checking

parent b20054df
...@@ -1339,14 +1339,21 @@ SDL_SetWindowPosition(SDL_Window * window, int x, int y) ...@@ -1339,14 +1339,21 @@ SDL_SetWindowPosition(SDL_Window * window, int x, int y)
void void
SDL_GetWindowPosition(SDL_Window * window, int *x, int *y) SDL_GetWindowPosition(SDL_Window * window, int *x, int *y)
{ {
CHECK_WINDOW_MAGIC(window, ); if (_this && window && window->magic == &_this->window_magic) {
if (x) { if (x) {
*x = window->x; *x = window->x;
} }
if (y) { if (y) {
*y = window->y; *y = window->y;
} }
} else {
if (x) {
*x = 0;
}
if (y) {
*y = 0;
}
}
} }
void void
...@@ -1366,7 +1373,7 @@ SDL_SetWindowSize(SDL_Window * window, int w, int h) ...@@ -1366,7 +1373,7 @@ SDL_SetWindowSize(SDL_Window * window, int w, int h)
void void
SDL_GetWindowSize(SDL_Window * window, int *w, int *h) SDL_GetWindowSize(SDL_Window * window, int *w, int *h)
{ {
if (window) { if (_this && window && window->magic == &_this->window_magic) {
if (w) { if (w) {
*w = window->w; *w = window->w;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment