From 5d1bee0f17351218b24ba0ff1e7267041fc3204e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20P=2E=20Tjern=C3=B8?= 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); }