From a56e44885092966f0f1a1b038f4ae3d26511f02f Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Thu, 10 Feb 2011 19:21:13 +0000 Subject: [PATCH] Add minimize command (#4531) --- code/client/cl_main.c | 2 ++ code/sdl/sdl_glimp.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/code/client/cl_main.c b/code/client/cl_main.c index a4db7f21..1661b8fd 100644 --- a/code/client/cl_main.c +++ b/code/client/cl_main.c @@ -129,6 +129,7 @@ int serverStatusCount; void hA3Dg_ExportRenderGeom (refexport_t *incoming_re); #endif +extern void GLimp_Minimize(void); extern void SV_BotFrame( int time ); void CL_CheckForResend( void ); void CL_ShowIP_f(void); @@ -3271,6 +3272,7 @@ void CL_Init( void ) { Cmd_AddCommand ("model", CL_SetModel_f ); Cmd_AddCommand ("video", CL_Video_f ); Cmd_AddCommand ("stopvideo", CL_StopVideo_f ); + Cmd_AddCommand("minimize", GLimp_Minimize); CL_InitRef(); SCR_Init (); diff --git a/code/sdl/sdl_glimp.c b/code/sdl/sdl_glimp.c index dd005da0..f9e677d5 100644 --- a/code/sdl/sdl_glimp.c +++ b/code/sdl/sdl_glimp.c @@ -99,6 +99,19 @@ void GLimp_Shutdown( void ) Com_Memset( &glState, 0, sizeof( glState ) ); } +/* +=============== +GLimp_Minimize + +Minimize the game so that user is back at the desktop +=============== +*/ +void GLimp_Minimize(void) +{ + SDL_WM_IconifyWindow(); +} + + /* =============== GLimp_LogComment