Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed issue where the context couldn't be unbound after the window is…
Browse files Browse the repository at this point in the history
… shown because the current context was already marked as NULL. (Thanks to John McDonald for tracking that down!)
  • Loading branch information
slouken committed Sep 11, 2012
1 parent f478fdc commit f2ce8f0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/video/SDL_video.c
Expand Up @@ -107,11 +107,6 @@ static SDL_VideoDevice *_this = NULL;
return retval; \
}

#define INVALIDATE_GLCONTEXT() \
_this->current_glwin = NULL; \
_this->current_glctx = NULL;


/* Support for framebuffer emulation using an accelerated renderer */

#define SDL_WINDOWTEXTUREDATA "_SDL_WindowTextureData"
Expand Down Expand Up @@ -1865,14 +1860,12 @@ SDL_GetWindowGrab(SDL_Window * window)
void
SDL_OnWindowShown(SDL_Window * window)
{
INVALIDATE_GLCONTEXT();
SDL_OnWindowRestored(window);
}

void
SDL_OnWindowHidden(SDL_Window * window)
{
INVALIDATE_GLCONTEXT();
SDL_UpdateFullscreenMode(window, SDL_FALSE);
}

Expand All @@ -1897,6 +1890,13 @@ SDL_OnWindowRestored(SDL_Window * window)
if (FULLSCREEN_VISIBLE(window)) {
SDL_UpdateFullscreenMode(window, SDL_TRUE);
}

/* This needs to be done on iOS to rebind the nscontext to the view,
and (hopefully) doesn't hurt on other systems.
*/
if (window == _this->current_glwin) {
_this->GL_MakeCurrent(_this, _this->current_glwin, _this->current_glctx);
}
}

void
Expand Down

0 comments on commit f2ce8f0

Please sign in to comment.