src/video/windows/SDL_windowsopengl.c
changeset 6522 edacce9402fb
parent 6406 3a098f2d4dea
child 6885 700f1b25f77f
     1.1 --- a/src/video/windows/SDL_windowsopengl.c	Sun Sep 30 01:01:48 2012 -0700
     1.2 +++ b/src/video/windows/SDL_windowsopengl.c	Sun Sep 30 01:08:48 2012 -0700
     1.3 @@ -613,6 +613,11 @@
     1.4      HDC hdc;
     1.5      int status;
     1.6  
     1.7 +    if (!_this->gl_data) {
     1.8 +        SDL_SetError("OpenGL not initialized");
     1.9 +        return -1;
    1.10 +    }
    1.11 +
    1.12      if (window) {
    1.13          hdc = ((SDL_WindowData *) window->driverdata)->hdc;
    1.14      } else {
    1.15 @@ -666,6 +671,9 @@
    1.16  void
    1.17  WIN_GL_DeleteContext(_THIS, SDL_GLContext context)
    1.18  {
    1.19 +    if (!_this->gl_data) {
    1.20 +        return;
    1.21 +    }
    1.22      _this->gl_data->wglDeleteContext((HGLRC) context);
    1.23  }
    1.24