fix fullscreen getting "stuck"
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user