static SDL_Surface *screen;
-static void IN_Init( void );
-static void IN_Shutdown( void );
-
/////////////////////////
// Input handling
////
if (!vid_usingmouse)
{
vid_usingmouse = true;
+ cl_ignoremousemove = true;
SDL_WM_GrabInput( SDL_GRAB_ON );
SDL_ShowCursor( SDL_DISABLE );
}
if (vid_usingmouse)
{
vid_usingmouse = false;
+ cl_ignoremousemove = true;
SDL_WM_GrabInput( SDL_GRAB_OFF );
SDL_ShowCursor( SDL_ENABLE );
}
}
}
-static void IN_Init( void )
-{
- // init keyboard
- SDL_EnableUNICODE( SDL_ENABLE );
- // enable key repeat since everyone expects it
- SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
-
- // init mouse
- vid_usingmouse = false;
-}
-
-static void IN_Shutdown( void )
-{
-}
-
/////////////////////
// Message Handling
////
if (SDL_Init(SDL_INIT_VIDEO) < 0)
Sys_Error ("Failed to init video: %s\n", SDL_GetError());
vid_isfullscreen = false;
-
- SDL_SetEventFilter( (SDL_EventFilter) Sys_EventFilter );
- IN_Init();
}
// set the icon (we dont use SDL here since it would be too much a PITA)
VID_Shutdown();
return false;
}
+
+ // set window title
VID_SetCaption();
+ // set up an event filter to ask confirmation on close button in WIN32
+ SDL_SetEventFilter( (SDL_EventFilter) Sys_EventFilter );
+ // init keyboard
+ SDL_EnableUNICODE( SDL_ENABLE );
+ // enable key repeat since everyone expects it
+ SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
gl_renderer = qglGetString(GL_RENDERER);
gl_vendor = qglGetString(GL_VENDOR);
vid_hidden = false;
vid_activewindow = false;
vid_usingmouse = false;
- IN_Init();
return true;
}
void VID_Shutdown (void)
{
- IN_Shutdown();
+ IN_Activate(false);
SDL_QuitSubSystem(SDL_INIT_VIDEO);
}
return !SDL_GetGammaRamp( ramps, ramps + 256, ramps + 512);
}
-void VID_GetWindowSize (int *x, int *y, int *width, int *height)
-{
- *x = *y = 0;
- *width = screen->w;
- *height = screen->h;
-}
-
void VID_Finish (void)
{
Uint8 appstate;