cvar_t joy_sensitivityyaw = {0, "joy_sensitivityyaw", "-1", "movement multiplier"};
cvar_t joy_sensitivityroll = {0, "joy_sensitivityroll", "1", "movement multiplier"};
-
static qboolean vid_usingmouse;
static qboolean vid_isfullscreen;
static int vid_numjoysticks = 0;
static int win_half_width = 50;
static int win_half_height = 50;
-static int stick_mouse = 0;
-static int grab_input = 1;
+static int video_bpp, video_flags;
static SDL_Surface *screen;
{
vid_usingmouse = true;
cl_ignoremousemove = true;
- if(grab_input) {
+ if(vid_grabkeyboard.integer) {
SDL_WM_GrabInput( SDL_GRAB_ON );
}
SDL_ShowCursor( SDL_DISABLE );
{
vid_usingmouse = false;
cl_ignoremousemove = true;
- if(grab_input) {
+ if(vid_grabkeyboard.integer) {
SDL_WM_GrabInput( SDL_GRAB_OFF );
}
SDL_ShowCursor( SDL_ENABLE );
int x, y;
if( vid_usingmouse )
{
- if(stick_mouse)
+ if(vid_stick_mouse.integer)
{
// have the mouse stuck in the middle, example use: prevent expose effect of beryl during the game when not using
// window grabbing. --blub
if (event.jbutton.button < 48)
Key_Event( event.jbutton.button + (event.jbutton.button < 16 ? K_JOY1 : K_AUX1 - 16), 0, (event.jbutton.state == SDL_PRESSED) );
break;
+ case SDL_VIDEORESIZE:
+ if(vid_resizable.integer < 2)
+ {
+ vid.width = event.resize.w;
+ vid.height = event.resize.h;
+ SDL_SetVideoMode(vid.width, vid.height, video_bpp, video_flags);
+ }
+ break;
}
// enable/disable sound on focus gain/loss
win_half_width = width>>1;
win_half_height = height>>1;
+ if(vid_resizable.integer)
+ flags |= SDL_RESIZABLE;
+
VID_OutputVersion();
/*
Con_Printf("Unable to load GL driver \"%s\": %s\n", drivername, SDL_GetError());
return false;
}
-
-
- if(COM_CheckParm("-resizable")) {
- flags |= SDL_RESIZABLE;
- }
-
- stick_mouse = COM_CheckParm("-stick_mouse");
- if(COM_CheckParm("-no_input_grabbing")) {
- grab_input = 0;
- } else {
- grab_input = 1;
- }
if ((qglGetString = (const GLubyte* (GLAPIENTRY *)(GLenum name))GL_GetProcAddress("glGetString")) == NULL)
{
if (stereobuffer)
SDL_GL_SetAttribute (SDL_GL_STEREO, 1);
+ video_bpp = bpp;
+ video_flags = flags;
screen = SDL_SetVideoMode(width, height, bpp, flags);
if (screen == NULL)
vid_activewindow = false;
vid_usingmouse = false;
- if(!grab_input)
+ if(!vid_grabkeyboard.integer)
SDL_WM_GrabInput(SDL_GRAB_OFF);
return true;
}
cvar_t gl_combine = {0, "gl_combine", "1", "faster rendering by using GL_ARB_texture_env_combine extension (part of OpenGL 1.3 and above)"};
cvar_t gl_finish = {0, "gl_finish", "0", "make the cpu wait for the graphics processor at the end of each rendered frame (can help with strange input or video lag problems on some machines)"};
+cvar_t vid_stick_mouse = {CVAR_SAVE, "vid_stick_mouse", "0", "have the mouse stuck in the center of the screen" };
+cvar_t vid_resizable = {CVAR_SAVE, "vid_resizable", "0", "0: window not resizable, 1: resizable, 2: window can be resized but the framebuffer isn't adjusted" };
+
cvar_t v_gamma = {CVAR_SAVE, "v_gamma", "1", "inverse gamma correction value, a brightness effect that does not affect white or black, and tends to make the image grey and dull"};
cvar_t v_contrast = {CVAR_SAVE, "v_contrast", "1", "brightness of white (values above 1 give a brighter image with increased color saturation, unlike v_gamma)"};
cvar_t v_brightness = {CVAR_SAVE, "v_brightness", "0", "brightness of black, useful for monitors that are too dark"};
Cvar_RegisterVariable(&vid_vsync);
Cvar_RegisterVariable(&vid_mouse);
Cvar_RegisterVariable(&vid_grabkeyboard);
+ Cvar_RegisterVariable(&vid_stick_mouse);
+ Cvar_RegisterVariable(&vid_resizable);
Cvar_RegisterVariable(&vid_minwidth);
Cvar_RegisterVariable(&vid_minheight);
Cvar_RegisterVariable(&gl_combine);