comparison src/video/SDL_video.c @ 5247:78ce7bfd0faf

Better window parameter checking
author Sam Lantinga <slouken@libsdl.org>
date Thu, 10 Feb 2011 10:37:35 -0800
parents 9c0593fa27d6
children 3a8a452b49f0
comparison
equal deleted inserted replaced
5246:189b1bdb7baf 5247:78ce7bfd0faf
1337 } 1337 }
1338 1338
1339 void 1339 void
1340 SDL_GetWindowPosition(SDL_Window * window, int *x, int *y) 1340 SDL_GetWindowPosition(SDL_Window * window, int *x, int *y)
1341 { 1341 {
1342 CHECK_WINDOW_MAGIC(window, ); 1342 if (_this && window && window->magic == &_this->window_magic) {
1343 1343 if (x) {
1344 if (x) { 1344 *x = window->x;
1345 *x = window->x; 1345 }
1346 } 1346 if (y) {
1347 if (y) { 1347 *y = window->y;
1348 *y = window->y; 1348 }
1349 } else {
1350 if (x) {
1351 *x = 0;
1352 }
1353 if (y) {
1354 *y = 0;
1355 }
1349 } 1356 }
1350 } 1357 }
1351 1358
1352 void 1359 void
1353 SDL_SetWindowSize(SDL_Window * window, int w, int h) 1360 SDL_SetWindowSize(SDL_Window * window, int w, int h)
1364 } 1371 }
1365 1372
1366 void 1373 void
1367 SDL_GetWindowSize(SDL_Window * window, int *w, int *h) 1374 SDL_GetWindowSize(SDL_Window * window, int *w, int *h)
1368 { 1375 {
1369 if (window) { 1376 if (_this && window && window->magic == &_this->window_magic) {
1370 if (w) { 1377 if (w) {
1371 *w = window->w; 1378 *w = window->w;
1372 } 1379 }
1373 if (h) { 1380 if (h) {
1374 *h = window->h; 1381 *h = window->h;