From a9506a43aacbf4d8220447bd0cd277f9998a7e9a Mon Sep 17 00:00:00 2001 From: "J?rgen P. Tjern?" Date: Wed, 7 Aug 2013 16:29:28 -0700 Subject: [PATCH] Ensure that the right window is current in SDL_GL_SwapWindow. --- src/video/SDL_video.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index a78104c54..bab6c6cb9 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -2854,6 +2854,12 @@ SDL_GL_SwapWindow(SDL_Window * window) SDL_SetError("The specified window isn't an OpenGL window"); return; } + + if (SDL_GL_GetCurrentWindow() != window) { + SDL_SetError("The specified window has not been made current"); + return; + } + _this->GL_SwapWindow(_this, window); }