static void DIB_CheckGamma(_THIS)
{
#ifndef NO_GAMMA_SUPPORT
HDC hdc;
WORD ramp[3*256];
/* If we fail to get gamma, disable gamma control */
hdc = GetDC(SDL_Window);
if ( ! GetDeviceGammaRamp(hdc, ramp) ) {
this->GetGammaRamp = NULL;
this->SetGammaRamp = NULL;
}
ReleaseDC(SDL_Window, hdc);
#endif /* !NO_GAMMA_SUPPORT */
}
If this code is failing (you might add some debug output or something
maybe?) that would explain it. In what cases this code succeeds though, I
can’t guess.
The windx5 directory has a much messier set of DirectDraw gamma code, but
that doesn’t even work with OpenGL windows since they don’t have DDraw
contexts. Sam, could you add GetDeviceGammaRamp/SetDeviceGammaRamp
support to the windx5 backend for non-DDraw windows? Looks easy enough to
do, but without a winbox to test on, I’m hesitant to touch it.On Tue, Apr 09, 2002 at 11:02:37AM +0100, Dominique Louis wrote:
Hi Joseph,
From what I can tell the call to SDL_SetGamma always fails. I am using
a Dell Laptop which I definately know supports gamma ramping and it
fails onthe following line…
gamma := 1.0;
if ( SDL_SetGamma(gamma, gamma, gamma) < 0 ) // <— always returns
less than zero
{
fprintf(stderr, ‘Unable to set gamma: %s\n’, SDL_GetError());
exit(1);
}
Can Sam or anyone else shed some light on this problem?
–
Joseph Carter Have chainsaw will travel
- wichert_ imagines master without a MTA
wichert: ehm? that might hinder peformance of the BTS 
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020409/88dcc212/attachment.pgp