Windows support for window resizing and fullscreen toggling.

Windows build fixes.

This was SVN commit r7607.
This commit is contained in:
Ykkrosh
2010-06-03 21:15:45 +00:00
parent 0f611042b1
commit a18aa24fe3
6 changed files with 130 additions and 29 deletions
+16 -1
View File
@@ -72,6 +72,13 @@ extern bool g_GameRestarted;
void kill_mainloop();
// to avoid redundant and/or recursive resizing, we save the new
// size after VIDEORESIZE messages and only update the video mode
// once per frame.
// these values are the latest resize message, and reset to 0 once we've
// updated the video mode
static int g_ResizedW;
static int g_ResizedH;
// main app message handler
static InReaction MainInputHandler(const SDL_Event_* ev)
@@ -83,7 +90,8 @@ static InReaction MainInputHandler(const SDL_Event_* ev)
break;
case SDL_VIDEORESIZE:
g_VideoMode.ResizeWindow(ev->ev.resize.w, ev->ev.resize.h);
g_ResizedW = ev->ev.resize.w;
g_ResizedH = ev->ev.resize.h;
break;
case SDL_HOTKEYDOWN:
@@ -266,6 +274,13 @@ static void Frame()
PumpEvents();
PROFILE_END("input");
// respond to pumped resize events
if (g_ResizedW || g_ResizedH)
{
g_VideoMode.ResizeWindow(g_ResizedW, g_ResizedH);
g_ResizedW = g_ResizedH = 0;
}
PROFILE_START("network poll");
if (g_NetServer)
g_NetServer->Poll();