diff --git a/libgag/include/SDLGraphicContext.h b/libgag/include/SDLGraphicContext.h index e07e1388..2bbbd2b6 100644 --- a/libgag/include/SDLGraphicContext.h +++ b/libgag/include/SDLGraphicContext.h @@ -326,6 +326,7 @@ namespace GAGCore Uint32 optionFlags; std::string windowTitle; std::string appIcon; + int resizeTimer; public: //! Constructor. Create a new window of size (w,h). If useGPU is true, use GPU for accelerated 2D (OpenGL or DX) diff --git a/libgag/src/GraphicContext.cpp b/libgag/src/GraphicContext.cpp index 60d80dd8..701d5d13 100644 --- a/libgag/src/GraphicContext.cpp +++ b/libgag/src/GraphicContext.cpp @@ -1674,8 +1674,10 @@ namespace GAGCore #ifdef HAVE_OPENGL if (_gc->optionFlags & GraphicContext::USEGPU) { + if (!resizeTimer && EventListener::instance()->isResizing()) + resizeTimer++; // upload - if (surface->dirty || EventListener::instance()->isResizing()) + if (surface->dirty || resizeTimer) surface->uploadToTexture(); // state change @@ -2275,6 +2277,8 @@ namespace GAGCore { SDL_UpdateWindowSurface(window); } + if (resizeTimer) + resizeTimer--; } }