src/SDL_compat.c
changeset 5286 73d27f06a715
parent 5267 93ea62a5ba8f
child 5287 d1823573d005
equal deleted inserted replaced
5285:ee03772989eb 5286:73d27f06a715
    30 #include "video/SDL_pixels_c.h"
    30 #include "video/SDL_pixels_c.h"
    31 #include "render/SDL_yuv_sw_c.h"
    31 #include "render/SDL_yuv_sw_c.h"
    32 
    32 
    33 
    33 
    34 static SDL_Window *SDL_VideoWindow = NULL;
    34 static SDL_Window *SDL_VideoWindow = NULL;
       
    35 static SDL_Surface *SDL_WindowSurface = NULL;
    35 static SDL_Surface *SDL_VideoSurface = NULL;
    36 static SDL_Surface *SDL_VideoSurface = NULL;
    36 static SDL_Surface *SDL_ShadowSurface = NULL;
    37 static SDL_Surface *SDL_ShadowSurface = NULL;
    37 static SDL_Surface *SDL_PublicSurface = NULL;
    38 static SDL_Surface *SDL_PublicSurface = NULL;
    38 static SDL_GLContext *SDL_VideoContext = NULL;
    39 static SDL_GLContext *SDL_VideoContext = NULL;
    39 static Uint32 SDL_VideoFlags = 0;
    40 static Uint32 SDL_VideoFlags = 0;
   408         SDL_VideoSurface->w = width;
   409         SDL_VideoSurface->w = width;
   409         SDL_VideoSurface->h = height;
   410         SDL_VideoSurface->h = height;
   410         return 0;
   411         return 0;
   411     }
   412     }
   412 
   413 
   413     /* Destroy the screen texture and recreate it */
   414     /* Get the surface for the window */
   414     SDL_VideoSurface = SDL_GetWindowSurface(SDL_VideoWindow);
   415     SDL_WindowSurface = SDL_GetWindowSurface(SDL_VideoWindow);
   415     if (!SDL_VideoSurface) {
   416     if (!SDL_WindowSurface) {
   416         return -1;
   417         return -1;
   417     }
   418     }
   418 
   419 
   419     if (SDL_ShadowSurface) {
   420     if (SDL_ShadowSurface) {
   420         SDL_ShadowSurface->w = width;
   421         SDL_ShadowSurface->w = width;
   547         SDL_PublicSurface = SDL_VideoSurface;
   548         SDL_PublicSurface = SDL_VideoSurface;
   548         return SDL_PublicSurface;
   549         return SDL_PublicSurface;
   549     }
   550     }
   550 
   551 
   551     /* Create the screen surface */
   552     /* Create the screen surface */
   552     SDL_VideoSurface = SDL_GetWindowSurface(SDL_VideoWindow);
   553     SDL_WindowSurface = SDL_GetWindowSurface(SDL_VideoWindow);
   553     if (!SDL_VideoSurface) {
   554     if (!SDL_WindowSurface) {
   554         return NULL;
   555         return NULL;
   555     }
   556     }
   556     SDL_VideoSurface->flags |= surface_flags;
   557     SDL_VideoSurface->flags |= surface_flags;
   557 
   558 
   558     /* Create a shadow surface if necessary */
   559     /* Create a shadow surface if necessary */