Fix viewport not being updated when resizing window when no scene is active

This commit is contained in:
Magnus Norddahl 2016-08-13 18:24:27 +02:00 committed by Christoph Oelckers
parent 4e38f31a86
commit 847d2e8862
1 changed files with 3 additions and 0 deletions

View File

@ -286,6 +286,9 @@ void FGLRenderer::Begin2D()
{ {
if (FGLRenderBuffers::IsEnabled()) if (FGLRenderBuffers::IsEnabled())
{ {
if (!mDrawingScene2D) // For when there's no scene rendered (main menu and intermission)
SetOutputViewport(nullptr);
mBuffers->Setup(mScreenViewport.width, mScreenViewport.height, mSceneViewport.width, mSceneViewport.height); mBuffers->Setup(mScreenViewport.width, mScreenViewport.height, mSceneViewport.width, mSceneViewport.height);
if (mDrawingScene2D) if (mDrawingScene2D)
mBuffers->BindSceneFB(); mBuffers->BindSceneFB();