Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_x11gamma.c @ 292:eadc0746dfaf
Added SDL_LockRect() and SDL_UnlockRect()
Incorporated XFree86 extension libraries into the source
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 05 Mar 2002 19:55:32 +0000 |
parents | e8157fcb3114 |
children | f6ffac90895c |
comparison
equal
deleted
inserted
replaced
291:68a8a8237c09 | 292:eadc0746dfaf |
---|---|
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 >= 200) { | 40 if (use_vidmode >= 200) { |
41 XF86VidModeGamma gamma; | 41 SDL_NAME(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 ) { |
46 gamma.red = MIN_GAMMA; | 46 gamma.red = MIN_GAMMA; |
65 gamma.blue = MAX_GAMMA; | 65 gamma.blue = MAX_GAMMA; |
66 } else { | 66 } else { |
67 gamma.blue = blue; | 67 gamma.blue = blue; |
68 } | 68 } |
69 if ( SDL_GetAppState() & SDL_APPACTIVE ) { | 69 if ( SDL_GetAppState() & SDL_APPACTIVE ) { |
70 succeeded = XVidMode(SetGamma, (SDL_Display, SDL_Screen, &gamma)); | 70 succeeded = SDL_NAME(XF86VidModeSetGamma)(SDL_Display, SDL_Screen, &gamma); |
71 XSync(SDL_Display, False); | 71 XSync(SDL_Display, False); |
72 } else { | 72 } else { |
73 gamma_saved[0] = gamma.red; | 73 gamma_saved[0] = gamma.red; |
74 gamma_saved[1] = gamma.green; | 74 gamma_saved[1] = gamma.green; |
75 gamma_saved[2] = gamma.blue; | 75 gamma_saved[2] = gamma.blue; |
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 >= 2) { | 101 if (use_vidmode >= 2) { |
102 XF86VidModeGamma gamma; | 102 SDL_NAME(XF86VidModeGamma) gamma; |
103 if (XVidMode(GetGamma, (SDL_Display, SDL_Screen, &gamma))) { | 103 if (SDL_NAME(XF86VidModeGetGamma)(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; |
107 return 0; | 107 return 0; |
108 } | 108 } |