Commit d05ada52 authored by Ryan C. Gordon's avatar Ryan C. Gordon

The SwapInterval APIs should fail without a current OpenGL context.

parent b77354e7
......@@ -2510,8 +2510,10 @@ SDL_GL_SetSwapInterval(int interval)
if (!_this) {
SDL_UninitializedVideo();
return -1;
}
if (_this->GL_SetSwapInterval) {
} else if (_this->current_glctx == NULL) {
SDL_SetError("No OpenGL context has been made current");
return -1;
} else if (_this->GL_SetSwapInterval) {
return _this->GL_SetSwapInterval(_this, interval);
} else {
SDL_SetError("Setting the swap interval is not supported");
......@@ -2525,8 +2527,10 @@ SDL_GL_GetSwapInterval(void)
if (!_this) {
SDL_UninitializedVideo();
return -1;
}
if (_this->GL_GetSwapInterval) {
} else if (_this->current_glctx == NULL) {
SDL_SetError("No OpenGL context has been made current");
return -1;
} else if (_this->GL_GetSwapInterval) {
return _this->GL_GetSwapInterval(_this);
} else {
SDL_SetError("Getting the swap interval is not supported");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment