// Tell startup code that we have a client
int cl_available = true;
+
+qboolean vid_supportrefreshrate = false;
+
static qboolean vid_usingmouse;
static qboolean vid_isfullscreen;
#endif
}
-static keynum_t buttonremap[16] =
+static keynum_t buttonremap[18] =
{
K_MOUSE1,
K_MOUSE3,
K_MOUSE2,
+ K_MWHEELUP,
+ K_MWHEELDOWN,
K_MOUSE4,
K_MOUSE5,
K_MOUSE6,
}
break;
case SDL_MOUSEBUTTONDOWN:
- if (event.button.button <= 16)
+ if (event.button.button <= 18)
Key_Event( buttonremap[event.button.button - 1], 0, true );
break;
case SDL_MOUSEBUTTONUP:
- if (event.button.button <= 16)
+ if (event.button.button <= 18)
Key_Event( buttonremap[event.button.button - 1], 0, false );
break;
}
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()
version->major, version->minor, version->patch );
}
-int VID_InitMode(int fullscreen, int width, int height, int bpp)
+int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate)
{
int i;
int flags = SDL_OPENGL;
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;