SDL_SetGamma problem

Hi,

I just tried to add fading to my game using SDL_SetGamma(). As it turned out,
this feature seems not to be supported by my gfx driver (Xfree 4.0.x on a
Trident Blade3D running at 16bpp).

When running with SDL_VIDEODRIVER=dga, SDL_SetGamma() returns -1 as
documented. With the x11 videodriver (windowed and fullscreen) SDL_SetGamma()
returns success (didn’t check the exact value), but there’s no visible
effect. Same problem happens with ‘testgamma’.

Is this a problem of Xfree, that doesn’t report the lack of gamma support, or
is it located in SDL’s x11 driver? I’m using 1.2.0.

The fading effect is not essential for my game, and I want to skip it, if it
is not supported. Otherwise the user might get annoyed about delays with no
effect…–
Benjamin Niemann (P!\K)
pink at odahoda.de
http://www.odahoda.de

I just tried to add fading to my game using SDL_SetGamma(). As it turned out,
this feature seems not to be supported by my gfx driver (Xfree 4.0.x on a
Trident Blade3D running at 16bpp).

under X11, gamma is supported on DirectColor and PseudoColor visuals.
run xdpyinfo and see what DirectColor visuals you have

xdpyinfo says ‘default visual id: 0x23’ which is TrueColor.
Actually I don’t know much about X11 and the theory behind these ‘visuals’.
xdpyinfo lists DirectColor visuals with id 0x25 and 0x26.
Is there a way to select the default visual (XF86Config??) and is this
adviseable?
Or is the visual class selected for each window. Then it’s up to SDL’s
initcode to make the best choice.

But the important point is, that SDL_SetGamma() reports success although no
visible effect happens. My game will handle both cases anyway (w/ + w/o gamma
support). It just has to know about the (non-)existence of gamma support.On Tuesday 12 June 2001 10:40, you wrote:

I just tried to add fading to my game using SDL_SetGamma(). As it turned
out, this feature seems not to be supported by my gfx driver (Xfree 4.0.x
on a Trident Blade3D running at 16bpp).

under X11, gamma is supported on DirectColor and PseudoColor visuals.
run xdpyinfo and see what DirectColor visuals you have

Benjamin Niemann (P!\K)
pink at odahoda.de
http://www.odahoda.de

xdpyinfo says ‘default visual id: 0x23’ which is TrueColor.
Actually I don’t know much about X11 and the theory behind these ‘visuals’.

an X11 visual is a combination of depth and colour model, and determine how
X11 colormaps map pixel values to RGB colours on screen

xdpyinfo lists DirectColor visuals with id 0x25 and 0x26.
Is there a way to select the default visual (XF86Config??) and is this
adviseable?

there is usually a way but it won’t make a difference in this case.
SDL uses an appropriate DirectColor visual for >8bpp modes if possible

But the important point is, that SDL_SetGamma() reports success although no
visible effect happens. My game will handle both cases anyway (w/ + w/o gamma
support). It just has to know about the (non-)existence of gamma support.

it could be a bug in the X server — the best way of checking is to
write an xlib test app to verify it (create a DirectColor window, draw
something in it, and manipulate the colormap)

Make sure that your X11 window has focus, or the gamma change might not
take effect. Also try a different window manager, and running your
program in fullscreen