src/video/SDL_video.c
changeset 5571 a036283f779d
parent 5570 70b6f92e4539
child 6044 35448a5ea044
     1.1 --- a/src/video/SDL_video.c	Mon Jul 18 14:30:46 2011 -0700
     1.2 +++ b/src/video/SDL_video.c	Mon Jul 18 14:31:37 2011 -0700
     1.3 @@ -2510,8 +2510,10 @@
     1.4      if (!_this) {
     1.5          SDL_UninitializedVideo();
     1.6          return -1;
     1.7 -    }
     1.8 -    if (_this->GL_SetSwapInterval) {
     1.9 +    } else if (_this->current_glctx == NULL) {
    1.10 +        SDL_SetError("No OpenGL context has been made current");
    1.11 +        return -1;
    1.12 +    } else if (_this->GL_SetSwapInterval) {
    1.13          return _this->GL_SetSwapInterval(_this, interval);
    1.14      } else {
    1.15          SDL_SetError("Setting the swap interval is not supported");
    1.16 @@ -2525,8 +2527,10 @@
    1.17      if (!_this) {
    1.18          SDL_UninitializedVideo();
    1.19          return -1;
    1.20 -    }
    1.21 -    if (_this->GL_GetSwapInterval) {
    1.22 +    } else if (_this->current_glctx == NULL) {
    1.23 +        SDL_SetError("No OpenGL context has been made current");
    1.24 +        return -1;
    1.25 +    } else if (_this->GL_GetSwapInterval) {
    1.26          return _this->GL_GetSwapInterval(_this);
    1.27      } else {
    1.28          SDL_SetError("Getting the swap interval is not supported");