Fixed loading textures when the window starts hidden.

The viewport automatically resets to the window size when you programmatically resize the window.
This commit is contained in:
Sam Lantinga 2012-01-22 21:46:06 -05:00
parent f1b459aaf7
commit aaf23fe8af
7 changed files with 76 additions and 30 deletions

View file

@ -412,7 +412,9 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags)
static void
GL_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
{
if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) {
if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED ||
event->event == SDL_WINDOWEVENT_SHOWN ||
event->event == SDL_WINDOWEVENT_HIDDEN) {
/* Rebind the context to the window area and update matrices */
SDL_CurrentContext = NULL;
}