+vid_mode_t *VID_GetDesktopMode(void)
+{
+#if SDL_MAJOR_VERSION != 1
+ SDL_DisplayMode mode;
+ int bpp;
+ Uint32 rmask, gmask, bmask, amask;
+ SDL_GetDesktopDisplayMode(0, &mode);
+ SDL_PixelFormatEnumToMasks(mode.format, &bpp, &rmask, &gmask, &bmask, &amask);
+ modes[k].width = mode.w;
+ modes[k].height = mode.h;
+ modes[k].bpp = bpp;
+ modes[k].refreshrate = mode.refreshrate;
+ modes[k].pixelheight_num = 1;
+ modes[k].pixelheight_denom = 1; // SDL does not provide this
+#endif
+ return &desktop_mode;
+}
+