# HG changeset patch # User Sam Lantinga # Date 1259829792 0 # Node ID abefdc3349707d0dbe06e490594eb3b3bfeb6901 # Parent e7eec78e4b92d42590f6113931708943fdd5bace Added support for SDL 1.2 environment variables: SDL_VIDEO_FULLSCREEN_DISPLAY, SDL_VIDEO_FULLSCREEN_HEAD diff -r e7eec78e4b92 -r abefdc334970 src/SDL_compat.c --- a/src/SDL_compat.c Thu Dec 03 08:33:39 2009 +0000 +++ b/src/SDL_compat.c Thu Dec 03 08:43:12 2009 +0000 @@ -64,12 +64,26 @@ return NULL; } +static void +SelectVideoDisplay() +{ + const char *variable = SDL_getenv("SDL_VIDEO_FULLSCREEN_DISPLAY"); + if ( !variable ) { + variable = SDL_getenv("SDL_VIDEO_FULLSCREEN_HEAD"); + } + if ( variable ) { + SDL_SelectVideoDisplay(SDL_atoi(variable)); + } +} + const SDL_VideoInfo * SDL_GetVideoInfo(void) { static SDL_VideoInfo info; SDL_DisplayMode mode; + SelectVideoDisplay(); + /* Memory leak, compatibility code, who cares? */ if (!info.vfmt && SDL_GetDesktopDisplayMode(&mode) == 0) { int bpp; @@ -93,6 +107,8 @@ return 0; } + SelectVideoDisplay(); + if (!(flags & SDL_FULLSCREEN)) { SDL_DisplayMode mode; SDL_GetDesktopDisplayMode(&mode); @@ -124,6 +140,8 @@ return NULL; } + SelectVideoDisplay(); + if (!(flags & SDL_FULLSCREEN)) { return (SDL_Rect **) (-1); } @@ -495,6 +513,8 @@ } } + SelectVideoDisplay(); + SDL_GetDesktopDisplayMode(&desktop_mode); if (width == 0) {