fix fullscreen getting "stuck"

This commit is contained in:
Glenn Maynard
2002-12-28 21:37:18 +00:00
parent 387905a785
commit 9aa85c2293
3 changed files with 16 additions and 3 deletions
+12
View File
@@ -274,6 +274,18 @@ bool RageDisplay::SetVideoMode( bool windowed, int width, int height, int bpp, i
return need_reload;
}
void RageDisplay::ResolutionChanged(int width, int height)
{
g_CurrentWidth = width;
g_CurrentHeight = height;
SetViewport(0,0);
/* Clear any junk that's in the framebuffer. */
Clear();
Flip();
}
void RageDisplay::SetViewport(int shift_left, int shift_down)
{
/* left and down are on a 0..SCREEN_WIDTH, 0..SCREEN_HEIGHT scale.
+3
View File
@@ -30,6 +30,9 @@ public:
bool SetVideoMode( bool windowed, int width, int height, int bpp, int rate, bool vsync );
/* Call this when the resolution has been changed externally: */
void ResolutionChanged(int width, int height);
void Clear();
void Flip();
bool IsWindowed() const;
+1 -3
View File
@@ -410,9 +410,7 @@ static void GameLoop()
case SDL_QUIT:
return; /* exit the main loop */
case SDL_VIDEORESIZE:
PREFSMAN->m_iDisplayWidth = event.resize.w;
PREFSMAN->m_iDisplayHeight = event.resize.h;
ApplyGraphicOptions();
DISPLAY->ResolutionChanged(event.resize.w, event.resize.h);
break;
}
}