From de00a196d60bdcd7ece6ac61e169441a60a693ee Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 18 Jan 2006 09:18:17 +0000 Subject: [PATCH] set the viewport every frame --- stepmania/src/RageDisplay_OGL.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/stepmania/src/RageDisplay_OGL.cpp b/stepmania/src/RageDisplay_OGL.cpp index 97a946495d..37caa480b7 100644 --- a/stepmania/src/RageDisplay_OGL.cpp +++ b/stepmania/src/RageDisplay_OGL.cpp @@ -603,11 +603,6 @@ void RageDisplay_OGL::ResolutionChanged() { //LOG->Warn( "RageDisplay_OGL::ResolutionChanged" ); - int fWidth = g_pWind->GetActualVideoModeParams().width; - int fHeight = g_pWind->GetActualVideoModeParams().height; - - glViewport( 0, 0, fWidth, fHeight ); - /* Clear any junk that's in the framebuffer. */ if( BeginFrame() ) EndFrame(); @@ -665,6 +660,13 @@ int RageDisplay_OGL::GetMaxTextureSize() const bool RageDisplay_OGL::BeginFrame() { + /* We do this in here, rather than ResolutionChanged, or we won't update the + * viewport for the concurrent rendering context. */ + int fWidth = g_pWind->GetActualVideoModeParams().width; + int fHeight = g_pWind->GetActualVideoModeParams().height; + + glViewport( 0, 0, fWidth, fHeight ); + glClearColor( 0,0,0,1 ); SetZWrite( true ); glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );