diff -ru -x 'Entries*' -x Makefile /tmp/SDL-cvs/include/SDL_video.h /tmp/SDL-cvs-patched/include/SDL_video.h --- /tmp/SDL-cvs/include/SDL_video.h 2005-01-02 05:11:16.000000000 +0000 +++ /tmp/SDL-cvs-patched/include/SDL_video.h 2005-01-24 15:56:32.000000000 +0000 @@ -290,6 +290,14 @@ extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags); /* + * If possible, retrieves the current resolution of the user's display. If this + * operation is supported and succeeds, the width and height are written to the + * values pointed to by the parameters and 1 is returned. If unsupported or + * unsuccessful, the pointed to values are not touched and 0 is returned. + */ +extern DECLSPEC int SDLCALL SDL_GetDesktopMode(int *width, int *height); + +/* * Set up a video mode with the specified width, height and bits-per-pixel. * * If 'bpp' is 0, it is treated as the current display bits per pixel. diff -ru -x 'Entries*' -x Makefile /tmp/SDL-cvs/src/video/SDL_sysvideo.h /tmp/SDL-cvs-patched/src/video/SDL_sysvideo.h --- /tmp/SDL-cvs/src/video/SDL_sysvideo.h 2004-01-04 16:49:21.000000000 +0000 +++ /tmp/SDL-cvs-patched/src/video/SDL_sysvideo.h 2005-01-24 15:57:19.000000000 +0000 @@ -80,6 +80,9 @@ */ SDL_Rect **(*ListModes)(_THIS, SDL_PixelFormat *format, Uint32 flags); + /* Get the current resolution of the user's display. */ + int (*GetDesktopMode)(_THIS, int *width, int *height); + /* Set the requested video mode, returning a surface which will be set to the SDL_VideoSurface. The width and height will already be verified by ListModes(), and the video subsystem is free to diff -ru -x 'Entries*' -x Makefile /tmp/SDL-cvs/src/video/SDL_video.c /tmp/SDL-cvs-patched/src/video/SDL_video.c --- /tmp/SDL-cvs/src/video/SDL_video.c 2004-11-25 15:47:49.000000000 +0000 +++ /tmp/SDL-cvs-patched/src/video/SDL_video.c 2005-01-24 15:55:57.000000000 +0000 @@ -341,6 +341,24 @@ } /* + * If possible, retrieves the current resolution of the user's display. If this + * operation is supported and succeeds, the width and height are written to the + * values pointed to by the parameters and 1 is returned. If unsupported or + * unsuccessful, the pointed to values are not touched and 0 is returned. + */ +int SDL_GetDesktopMode(int *width, int *height) +{ + SDL_VideoDevice *video = current_video; + SDL_VideoDevice *this = current_video; + + if (video && video->GetDesktopMode) { + return video->GetDesktopMode(this, width, height); + } else { + return 0; + } +} + +/* * Check to see if a particular video mode is supported. * It returns 0 if the requested mode is not supported under any bit depth, * or returns the bits-per-pixel of the closest available mode with the diff -ru -x 'Entries*' -x Makefile /tmp/SDL-cvs/src/video/wincommon/SDL_syswm.c /tmp/SDL-cvs-patched/src/video/wincommon/SDL_syswm.c --- /tmp/SDL-cvs/src/video/wincommon/SDL_syswm.c 2002-08-17 19:03:06.000000000 +0100 +++ /tmp/SDL-cvs-patched/src/video/wincommon/SDL_syswm.c 2005-01-24 13:39:55.000000000 +0000 @@ -285,3 +285,15 @@ return(-1); } } + +int WIN_GetDesktopMode(_THIS, int *width, int *height) +{ + DEVMODE dm; + if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm)) { + *width = dm.dmPelsWidth; + *height = dm.dmPelsHeight; + return 1; + } else { + return 0; + } +} diff -ru -x 'Entries*' -x Makefile /tmp/SDL-cvs/src/video/wincommon/SDL_syswm_c.h /tmp/SDL-cvs-patched/src/video/wincommon/SDL_syswm_c.h --- /tmp/SDL-cvs/src/video/wincommon/SDL_syswm_c.h 2004-01-04 16:49:26.000000000 +0000 +++ /tmp/SDL-cvs-patched/src/video/wincommon/SDL_syswm_c.h 2005-01-24 13:40:35.000000000 +0000 @@ -36,4 +36,4 @@ extern int WIN_IconifyWindow(_THIS); extern SDL_GrabMode WIN_GrabInput(_THIS, SDL_GrabMode mode); extern int WIN_GetWMInfo(_THIS, SDL_SysWMinfo *info); - +extern int WIN_GetDesktopMode(_THIS, int *width, int *height); diff -ru -x 'Entries*' -x Makefile /tmp/SDL-cvs/src/video/windib/SDL_dibvideo.c /tmp/SDL-cvs-patched/src/video/windib/SDL_dibvideo.c --- /tmp/SDL-cvs/src/video/windib/SDL_dibvideo.c 2004-11-12 23:22:08.000000000 +0000 +++ /tmp/SDL-cvs-patched/src/video/windib/SDL_dibvideo.c 2005-01-24 13:41:30.000000000 +0000 @@ -142,6 +142,7 @@ /* Set the function pointers */ device->VideoInit = DIB_VideoInit; device->ListModes = DIB_ListModes; + device->GetDesktopMode = WIN_GetDesktopMode; device->SetVideoMode = DIB_SetVideoMode; device->UpdateMouse = WIN_UpdateMouse; device->SetColors = DIB_SetColors; diff -ru -x 'Entries*' -x Makefile /tmp/SDL-cvs/src/video/windx5/SDL_dx5video.c /tmp/SDL-cvs-patched/src/video/windx5/SDL_dx5video.c --- /tmp/SDL-cvs/src/video/windx5/SDL_dx5video.c 2004-11-12 23:22:08.000000000 +0000 +++ /tmp/SDL-cvs-patched/src/video/windx5/SDL_dx5video.c 2005-01-24 13:42:11.000000000 +0000 @@ -591,6 +591,7 @@ /* Set the function pointers */ device->VideoInit = DX5_VideoInit; device->ListModes = DX5_ListModes; + device->GetDesktopMode = WIN_GetDesktopMode; device->SetVideoMode = DX5_SetVideoMode; device->UpdateMouse = WIN_UpdateMouse; device->CreateYUVOverlay = DX5_CreateYUVOverlay; diff -ru -x 'Entries*' -x Makefile /tmp/SDL-cvs/src/video/x11/SDL_x11modes.c /tmp/SDL-cvs-patched/src/video/x11/SDL_x11modes.c --- /tmp/SDL-cvs/src/video/x11/SDL_x11modes.c 2004-11-12 21:25:42.000000000 +0000 +++ /tmp/SDL-cvs-patched/src/video/x11/SDL_x11modes.c 2005-01-24 13:43:09.000000000 +0000 @@ -634,6 +634,13 @@ } } +int X11_GetDesktopMode(_THIS, int *width, int *height) +{ + *width = DisplayWidth(SDL_Display, SDL_Screen); + *height = DisplayHeight(SDL_Display, SDL_Screen); + return 1; +} + int X11_ResizeFullScreen(_THIS) { int x, y; diff -ru -x 'Entries*' -x Makefile /tmp/SDL-cvs/src/video/x11/SDL_x11modes_c.h /tmp/SDL-cvs-patched/src/video/x11/SDL_x11modes_c.h --- /tmp/SDL-cvs/src/video/x11/SDL_x11modes_c.h 2004-01-04 16:49:27.000000000 +0000 +++ /tmp/SDL-cvs-patched/src/video/x11/SDL_x11modes_c.h 2005-01-24 13:43:54.000000000 +0000 @@ -39,6 +39,7 @@ extern int X11_GetVideoModes(_THIS); extern SDL_Rect **X11_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags); extern void X11_FreeVideoModes(_THIS); +extern int X11_GetDesktopMode(_THIS, int *width, int *height); extern int X11_ResizeFullScreen(_THIS); extern void X11_WaitMapped(_THIS, Window win); extern void X11_WaitUnmapped(_THIS, Window win); diff -ru -x 'Entries*' -x Makefile /tmp/SDL-cvs/src/video/x11/SDL_x11video.c /tmp/SDL-cvs-patched/src/video/x11/SDL_x11video.c --- /tmp/SDL-cvs/src/video/x11/SDL_x11video.c 2004-03-02 19:38:55.000000000 +0000 +++ /tmp/SDL-cvs-patched/src/video/x11/SDL_x11video.c 2005-01-24 13:44:38.000000000 +0000 @@ -139,6 +139,7 @@ /* Set the function pointers */ device->VideoInit = X11_VideoInit; device->ListModes = X11_ListModes; + device->GetDesktopMode = X11_GetDesktopMode; device->SetVideoMode = X11_SetVideoMode; device->ToggleFullScreen = X11_ToggleFullScreen; device->UpdateMouse = X11_UpdateMouse;