src/SDL_compat.c
changeset 3098 5f372cef955d
parent 3034 0e821769fc51
child 3139 7f684f249ec9
equal deleted inserted replaced
3097:0d12e8f1de3c 3098:5f372cef955d
   492     if (!SDL_GetVideoDevice()) {
   492     if (!SDL_GetVideoDevice()) {
   493         if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0) {
   493         if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0) {
   494             return NULL;
   494             return NULL;
   495         }
   495         }
   496     }
   496     }
       
   497     
       
   498     SDL_GetDesktopDisplayMode(&desktop_mode);
       
   499 
       
   500     if (width == 0) {
       
   501         width = desktop_mode.w;
       
   502     }
       
   503     if (height == 0) {
       
   504         height = desktop_mode.h;
       
   505     }
   497 
   506 
   498     /* See if we can simply resize the existing window and surface */
   507     /* See if we can simply resize the existing window and surface */
   499     if (SDL_ResizeVideoMode(width, height, bpp, flags) == 0) {
   508     if (SDL_ResizeVideoMode(width, height, bpp, flags) == 0) {
   500         return SDL_PublicSurface;
   509         return SDL_PublicSurface;
   501     }
   510     }
   565     if (window_flags & SDL_WINDOW_BORDERLESS) {
   574     if (window_flags & SDL_WINDOW_BORDERLESS) {
   566         surface_flags |= SDL_NOFRAME;
   575         surface_flags |= SDL_NOFRAME;
   567     }
   576     }
   568 
   577 
   569     /* Set up the desired display mode */
   578     /* Set up the desired display mode */
   570     SDL_GetDesktopDisplayMode(&desktop_mode);
       
   571     desktop_format = desktop_mode.format;
   579     desktop_format = desktop_mode.format;
   572     if (desktop_format && ((flags & SDL_ANYFORMAT)
   580     if (desktop_format && ((flags & SDL_ANYFORMAT)
   573                            || (bpp == SDL_BITSPERPIXEL(desktop_format)))) {
   581                            || (bpp == SDL_BITSPERPIXEL(desktop_format)))) {
   574         desired_format = desktop_format;
   582         desired_format = desktop_format;
   575     } else {
   583     } else {