mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-29 12:10:48 +00:00
first stab at hardware gamma support for windows. WILL screw up system gamma :)
This commit is contained in:
parent
6ba5e823b2
commit
cfb6c1db0a
1 changed files with 36 additions and 2 deletions
|
@ -1129,9 +1129,43 @@ VID_SetCaption (const char *text)
|
|||
}
|
||||
}
|
||||
|
||||
static WORD systemgammaramps[3][256];
|
||||
static WORD currentgammaramps[3][256];
|
||||
|
||||
qboolean
|
||||
VID_SetGamma (double gamma)
|
||||
{
|
||||
// FIXME: Need function for HW gamma correction
|
||||
return false;
|
||||
int i;
|
||||
HDC hdc = GetDC (NULL);
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
currentgammaramps[2][i] =
|
||||
currentgammaramps[1][i] =
|
||||
currentgammaramps[0][i] = gammatable[i] * 256;
|
||||
}
|
||||
|
||||
i = SetDeviceGammaRamp (hdc, ¤tgammaramps[0][0]);
|
||||
|
||||
ReleaseDC (NULL, hdc);
|
||||
return i;
|
||||
}
|
||||
|
||||
void
|
||||
VID_SaveGamma (void)
|
||||
{
|
||||
HDC hdc = GetDC (NULL);
|
||||
|
||||
GetDeviceGammaRamp (hdc, &systemgammaramps[0][0]);
|
||||
|
||||
ReleaseDC (NULL, hdc);
|
||||
}
|
||||
|
||||
void
|
||||
VID_RestoreGamma (void)
|
||||
{
|
||||
HDC hdc = GetDC (NULL);
|
||||
|
||||
SetDeviceGammaRamp (hdc, &systemgammaramps[0][0]);
|
||||
|
||||
ReleaseDC (NULL, hdc);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue