comparison src/video/SDL_video.c @ 1963:2590b68531ef

Added SDL_GetCurrentVideoDisplay()
author Sam Lantinga <slouken@libsdl.org>
date Wed, 02 Aug 2006 03:20:52 +0000
parents ba0d62354872
children a788656ca29a
comparison
equal deleted inserted replaced
1962:c92e5f3e68d9 1963:2590b68531ef
353 { 353 {
354 if (!_this) { 354 if (!_this) {
355 SDL_UninitializedVideo(); 355 SDL_UninitializedVideo();
356 return (-1); 356 return (-1);
357 } 357 }
358 if (index >= 0) { 358 if (index < 0 || index >= _this->num_displays) {
359 if (index >= _this->num_displays) { 359 SDL_SetError("index must be in the range 0 - %d",
360 SDL_SetError("index must be in the range 0 - %d", 360 _this->num_displays - 1);
361 _this->num_displays - 1); 361 return -1;
362 return -1; 362 }
363 } 363 _this->current_display = index;
364 _this->current_display = index; 364 return 0;
365 }
366
367 int
368 SDL_GetCurrentVideoDisplay(void)
369 {
370 if (!_this) {
371 SDL_UninitializedVideo();
372 return (-1);
365 } 373 }
366 return _this->current_display; 374 return _this->current_display;
367 } 375 }
368 376
369 SDL_bool 377 SDL_bool