Added support for SDL 1.2 environment variables:
SDL_VIDEO_FULLSCREEN_DISPLAY, SDL_VIDEO_FULLSCREEN_HEAD --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404261
This commit is contained in:
parent
e12e0c04d3
commit
5bb70a9b91
1 changed files with 20 additions and 0 deletions
|
@ -64,12 +64,26 @@ SDL_VideoDriverName(char *namebuf, int maxlen)
|
|||
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 @@ SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SelectVideoDisplay();
|
||||
|
||||
if (!(flags & SDL_FULLSCREEN)) {
|
||||
SDL_DisplayMode mode;
|
||||
SDL_GetDesktopDisplayMode(&mode);
|
||||
|
@ -124,6 +140,8 @@ SDL_ListModes(const SDL_PixelFormat * format, Uint32 flags)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SelectVideoDisplay();
|
||||
|
||||
if (!(flags & SDL_FULLSCREEN)) {
|
||||
return (SDL_Rect **) (-1);
|
||||
}
|
||||
|
@ -495,6 +513,8 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
|
|||
}
|
||||
}
|
||||
|
||||
SelectVideoDisplay();
|
||||
|
||||
SDL_GetDesktopDisplayMode(&desktop_mode);
|
||||
|
||||
if (width == 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue