HandleSDLEvents is too small to be worth splitting

handle hwnd changes within the renderers, since it's tied to the window
This commit is contained in:
Glenn Maynard
2004-06-14 03:54:46 +00:00
parent aa7ad967ae
commit 58cf9f21c5
3 changed files with 1 additions and 43 deletions
-19
View File
@@ -322,25 +322,6 @@ RageSurface *RageSurfaceFromSDLSurface( SDL_Surface *surf )
return ret;
}
void HandleSDLEvents()
{
/* This needs to be called before anything that handles SDL events. */
SDL_PumpEvents();
// process all queued events
SDL_Event event;
while(SDL_GetEvent(event, SDL_QUITMASK))
{
switch(event.type)
{
case SDL_QUIT:
LOG->Trace("SDL_QUIT: shutting down");
ExitGame();
break;
}
}
}
void SDL_UpdateHWnd()
{
#ifdef _WINDOWS
-2
View File
@@ -31,8 +31,6 @@ void mySDL_WM_SetIcon( CString sIconFile );
SDL_Surface *SDLSurfaceFromRageSurface( RageSurface *surf );
RageSurface *RageSurfaceFromSDLSurface( SDL_Surface *surf );
void HandleSDLEvents();
void SDL_UpdateHWnd();
#endif
+1 -22
View File
@@ -73,6 +73,7 @@
#define ZIPS_DIR "Packages/"
#ifdef _WINDOWS
/* The renderer is responsible for setting this, and updating it when it changes. */
HWND g_hWndMain = NULL;
#endif
@@ -82,19 +83,6 @@ char **g_argv = NULL;
static bool g_bHasFocus = true;
static bool g_bQuitting = false;
void UpdateHWnd()
{
#ifdef _WINDOWS
/* Grab the window manager specific information */
SDL_SysWMinfo info;
SDL_VERSION(&info.version);
if ( SDL_GetWMInfo(&info) < 0 )
RageException::Throw( "SDL_GetWMInfo failed" );
g_hWndMain = info.window;
#endif
}
static RageDisplay::VideoModeParams GetCurVideoModeParams()
{
return RageDisplay::VideoModeParams(
@@ -173,9 +161,6 @@ void ApplyGraphicOptions()
StoreActualGraphicOptions( false );
/* Recreating the window changes the hwnd. */
UpdateHWnd();
/* Give the input handlers a chance to re-open devices as necessary. */
INPUTMAN->WindowReset();
}
@@ -1095,12 +1080,6 @@ int main(int argc, char* argv[])
StoreActualGraphicOptions( true );
/* Now that we've started DISPLAY, we can set up event masks. */
mySDL_EventState(SDL_QUIT, SDL_ENABLE);
mySDL_EventState(SDL_ACTIVEEVENT, SDL_ENABLE);
UpdateHWnd();
SONGMAN->PreloadSongImages();
/* This initializes objects that change the SDL event mask, and has other