static qboolean vid_usinghidecursor = false;
static qboolean vid_usingvsync = false;
static qboolean vid_usevsync = false;
-static qboolean vid_x11_hardwaregammasupported = false;
#ifdef USEDGA
static qboolean vid_x11_dgasupported = false;
#endif
-static int vid_x11_gammarampsize = 0;
#ifdef USEDGA
cvar_t vid_dgamouse = {CVAR_SAVE, "vid_dgamouse", "0", "make use of DGA mouse input"};
break;
// window restored
vid_hidden = false;
- VID_RestoreSystemGamma();
if(vid_isvidmodefullscreen)
{
break;
// window iconified/rolledup/whatever
vid_hidden = true;
- VID_RestoreSystemGamma();
if(vid_isvidmodefullscreen)
XF86VidModeSwitchToMode(vidx11_display, vidx11_screen, &init_vidmode);
// window is no longer the input focus
vid_activewindow = false;
- VID_RestoreSystemGamma();
break;
case EnterNotify:
VID_EnableJoystick(false);
VID_SetMouse(false, false, false);
- VID_RestoreSystemGamma();
// FIXME: glXDestroyContext here?
if (vid_isvidmodefullscreen)
ctx = NULL;
GL_CloseLibrary();
- Key_ClearStates ();
}
static void signal_handler(int sig)
{
Con_Printf("Received signal %d, exiting...\n", sig);
- VID_RestoreSystemGamma();
Sys_Quit(1);
}
break;
}
- if (vid_x11_hardwaregammasupported)
- VID_UpdateGamma(false, vid_x11_gammarampsize);
-}
-
-int VID_SetGamma(unsigned short *ramps, int rampsize)
-{
- return XF86VidModeSetGammaRamp(vidx11_display, vidx11_screen, rampsize, ramps, ramps + rampsize, ramps + rampsize*2);
-}
-
-int VID_GetGamma(unsigned short *ramps, int rampsize)
-{
- return XF86VidModeGetGammaRamp(vidx11_display, vidx11_screen, rampsize, ramps, ramps + rampsize, ramps + rampsize*2);
+ VID_UpdateGamma();
}
void VID_Init(void)
vid_usingvsync = false;
vid_hidden = false;
vid_activewindow = true;
- vid_x11_hardwaregammasupported = XF86VidModeGetGammaRampSize(vidx11_display, vidx11_screen, &vid_x11_gammarampsize) != 0;
#ifdef USEDGA
vid_x11_dgasupported = XF86DGAQueryVersion(vidx11_display, &MajorVersion, &MinorVersion);
if (!vid_x11_dgasupported)
vid_usingvsync = false;
vid_hidden = false;
vid_activewindow = true;
- vid_x11_hardwaregammasupported = XF86VidModeGetGammaRampSize(vidx11_display, vidx11_screen, &vid_x11_gammarampsize) != 0;
#ifdef USEDGA
vid_x11_dgasupported = XF86DGAQueryVersion(vidx11_display, &MajorVersion, &MinorVersion);
if (!vid_x11_dgasupported)