src/video/SDL_video.c
changeset 6260 fd494c5f305b
parent 6214 b1a71f8189a6
child 6266 a4be1e781020
     1.1 --- a/src/video/SDL_video.c	Sun Jan 22 19:47:33 2012 -0500
     1.2 +++ b/src/video/SDL_video.c	Sun Jan 22 21:46:06 2012 -0500
     1.3 @@ -107,6 +107,11 @@
     1.4          return retval; \
     1.5      }
     1.6  
     1.7 +#define INVALIDATE_GLCONTEXT() \
     1.8 +    _this->current_glwin = NULL; \
     1.9 +    _this->current_glctx = NULL;
    1.10 +
    1.11 +
    1.12  /* Support for framebuffer emulation using an accelerated renderer */
    1.13  
    1.14  #define SDL_WINDOWTEXTUREDATA   "_SDL_WindowTextureData"
    1.15 @@ -1846,12 +1851,14 @@
    1.16  void
    1.17  SDL_OnWindowShown(SDL_Window * window)
    1.18  {
    1.19 +    INVALIDATE_GLCONTEXT();
    1.20      SDL_OnWindowRestored(window);
    1.21  }
    1.22  
    1.23  void
    1.24  SDL_OnWindowHidden(SDL_Window * window)
    1.25  {
    1.26 +    INVALIDATE_GLCONTEXT();
    1.27      SDL_UpdateFullscreenMode(window, SDL_FALSE);
    1.28  }
    1.29