Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_x11gamma.c @ 90:ee1f71c10889
Fix to allow SDL compiled under XFree v4 to work with XFree v3 xservers.
Contributed by Jarek Sobieszek
author | Sam Lantinga <slouken@lokigames.com> |
---|---|
date | Sat, 07 Jul 2001 08:08:42 +0000 |
parents | 74212992fb08 |
children | a1c973c35fef |
comparison
equal
deleted
inserted
replaced
89:69b8fac3e1c0 | 90:ee1f71c10889 |
---|---|
35 #define MIN_GAMMA (1.0/MAX_GAMMA) | 35 #define MIN_GAMMA (1.0/MAX_GAMMA) |
36 | 36 |
37 static int X11_SetGammaNoLock(_THIS, float red, float green, float blue) | 37 static int X11_SetGammaNoLock(_THIS, float red, float green, float blue) |
38 { | 38 { |
39 #ifdef XFREE86_VMGAMMA | 39 #ifdef XFREE86_VMGAMMA |
40 if (use_vidmode) { | 40 if (use_vidmode >= 2) { |
41 XF86VidModeGamma gamma; | 41 XF86VidModeGamma gamma; |
42 Bool succeeded; | 42 Bool succeeded; |
43 | 43 |
44 /* Clamp the gamma values */ | 44 /* Clamp the gamma values */ |
45 if ( red < MIN_GAMMA ) { | 45 if ( red < MIN_GAMMA ) { |
96 } | 96 } |
97 | 97 |
98 static int X11_GetGammaNoLock(_THIS, float *red, float *green, float *blue) | 98 static int X11_GetGammaNoLock(_THIS, float *red, float *green, float *blue) |
99 { | 99 { |
100 #ifdef XFREE86_VMGAMMA | 100 #ifdef XFREE86_VMGAMMA |
101 if (use_vidmode) { | 101 if (use_vidmode >= 2) { |
102 XF86VidModeGamma gamma; | 102 XF86VidModeGamma gamma; |
103 if (XVidMode(GetGamma, (SDL_Display, SDL_Screen, &gamma))) { | 103 if (XVidMode(GetGamma, (SDL_Display, SDL_Screen, &gamma))) { |
104 *red = gamma.red; | 104 *red = gamma.red; |
105 *green = gamma.green; | 105 *green = gamma.green; |
106 *blue = gamma.blue; | 106 *blue = gamma.blue; |