Fixed bug #963 (Crash with OpenGL & window resizing)
authorSam Lantinga <slouken@libsdl.org>
Wed, 16 Feb 2011 02:55:46 -0800
changeset 5312035797f48321
parent 5311 be06989af398
child 5313 7a569d09a682
Fixed bug #963 (Crash with OpenGL & window resizing)

The crash was already fixed, but the window doesn't need to be recreated if you're just changing the size of the OpenGL window.
src/SDL_compat.c
     1.1 --- a/src/SDL_compat.c	Wed Feb 16 02:55:32 2011 -0800
     1.2 +++ b/src/SDL_compat.c	Wed Feb 16 02:55:46 2011 -0800
     1.3 @@ -558,6 +558,8 @@
     1.4          surface_flags |= SDL_NOFRAME;
     1.5      }
     1.6  
     1.7 +    SDL_VideoFlags = flags;
     1.8 +
     1.9      /* If we're in OpenGL mode, just create a stub surface and we're done! */
    1.10      if (flags & SDL_OPENGL) {
    1.11          SDL_VideoContext = SDL_GL_CreateContext(SDL_VideoWindow);
    1.12 @@ -627,8 +629,6 @@
    1.13      SDL_PublicSurface =
    1.14          (SDL_ShadowSurface ? SDL_ShadowSurface : SDL_VideoSurface);
    1.15  
    1.16 -    SDL_VideoFlags = flags;
    1.17 -
    1.18      ClearVideoSurface();
    1.19  
    1.20      SetupScreenSaver(flags);