return;
icon = LoadIcon( GetModuleHandle( NULL ), MAKEINTRESOURCE( IDI_ICON1 ) );
- SetClassLong( info.window, GCL_HICON, (LONG) icon );
+#ifndef SetClassLongPtr
+#define SetClassLongPtr SetClassLong
+#endif
+#ifndef GCLP_HICON
+#define GCLP_HICON GCL_HICON
+#endif
+ SetClassLongPtr( info.window, GCLP_HICON, (LONG_PTR)icon );
}
#else
static void VID_SetCaption()
return !SDL_GetGammaRamp( ramps, ramps + 256, ramps + 512);
}
-void VID_Finish (void)
+void VID_Finish (qboolean allowmousegrab)
{
Uint8 appstate;
qboolean vid_usemouse;
//react on appstate changes
appstate = SDL_GetAppState();
- if( !( appstate & SDL_APPMOUSEFOCUS ) || !( appstate & SDL_APPINPUTFOCUS ) )
+ vid_hidden = !(appstate & SDL_APPACTIVE);
+
+ if( vid_hidden || !( appstate & SDL_APPMOUSEFOCUS ) || !( appstate & SDL_APPINPUTFOCUS ) )
vid_activewindow = false;
else
vid_activewindow = true;
vid_usemouse = false;
- if( vid_mouse.integer && !key_consoleactive && !cls.demoplayback )
+ if( allowmousegrab && vid_mouse.integer && !key_consoleactive && !cls.demoplayback )
vid_usemouse = true;
if( vid_isfullscreen )
vid_usemouse = true;