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:
@@ -322,25 +322,6 @@ RageSurface *RageSurfaceFromSDLSurface( SDL_Surface *surf )
|
|||||||
return ret;
|
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()
|
void SDL_UpdateHWnd()
|
||||||
{
|
{
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
|
|||||||
@@ -31,8 +31,6 @@ void mySDL_WM_SetIcon( CString sIconFile );
|
|||||||
SDL_Surface *SDLSurfaceFromRageSurface( RageSurface *surf );
|
SDL_Surface *SDLSurfaceFromRageSurface( RageSurface *surf );
|
||||||
RageSurface *RageSurfaceFromSDLSurface( SDL_Surface *surf );
|
RageSurface *RageSurfaceFromSDLSurface( SDL_Surface *surf );
|
||||||
|
|
||||||
void HandleSDLEvents();
|
|
||||||
|
|
||||||
void SDL_UpdateHWnd();
|
void SDL_UpdateHWnd();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -73,6 +73,7 @@
|
|||||||
#define ZIPS_DIR "Packages/"
|
#define ZIPS_DIR "Packages/"
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
|
/* The renderer is responsible for setting this, and updating it when it changes. */
|
||||||
HWND g_hWndMain = NULL;
|
HWND g_hWndMain = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -82,19 +83,6 @@ char **g_argv = NULL;
|
|||||||
static bool g_bHasFocus = true;
|
static bool g_bHasFocus = true;
|
||||||
static bool g_bQuitting = false;
|
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()
|
static RageDisplay::VideoModeParams GetCurVideoModeParams()
|
||||||
{
|
{
|
||||||
return RageDisplay::VideoModeParams(
|
return RageDisplay::VideoModeParams(
|
||||||
@@ -173,9 +161,6 @@ void ApplyGraphicOptions()
|
|||||||
|
|
||||||
StoreActualGraphicOptions( false );
|
StoreActualGraphicOptions( false );
|
||||||
|
|
||||||
/* Recreating the window changes the hwnd. */
|
|
||||||
UpdateHWnd();
|
|
||||||
|
|
||||||
/* Give the input handlers a chance to re-open devices as necessary. */
|
/* Give the input handlers a chance to re-open devices as necessary. */
|
||||||
INPUTMAN->WindowReset();
|
INPUTMAN->WindowReset();
|
||||||
}
|
}
|
||||||
@@ -1095,12 +1080,6 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
StoreActualGraphicOptions( true );
|
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();
|
SONGMAN->PreloadSongImages();
|
||||||
|
|
||||||
/* This initializes objects that change the SDL event mask, and has other
|
/* This initializes objects that change the SDL event mask, and has other
|
||||||
|
|||||||
Reference in New Issue
Block a user