About gamma support in video driver

Hello,

I would like to know what kind of gamma support must be present in the
video drivers.

For the moment, the 2 Atari video drivers don’t have any kind of *Gamma
functions. The testgamma program takes a very long time to run, and there
are no visible results (because of TrueColour mode (>8 bits), for
example).

So should I prevent the use of gamma support by adding Gamma functions in
the video drivers, the way the amiga CGX one does ? i.e. Just giving the
’not supported feature’ message ?

For me, I would assume that no gamma functions in video driver means no
gamma support. It appears to not be the case for me. The testgamma
program when calling SDL_SetGamma() receives a valid value telling that
gamma support is there.

It seems this as something to do with SDL_HWPALETTE. In the two video
drivers, I always set it (even in TrueColour modes). Is it wrong ?
Does SDL_HWPALETTE should be set only when bpp<=8, and modify the real
palette video registers ?

If this is the case, I have some work to do on the drivers…–
Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

I don’t believe SDL requires it to be implemented. Generally just a
message stating it’s not supported is sufficient.On Wed, 2002-09-25 at 10:59, Patrice Mandin wrote:

Hello,

I would like to know what kind of gamma support must be present in the
video drivers.

Quite honestly, this seems like a double standard to me… In SDL you
can query what video modes there are, and even what the best mode is,
but if you ask SDL for a mode that doesn’t exist, it will emulate with a
speed penalty…

I think this is the very thing that makes SDL much more easy to use than
DirectX… in directX you always need ot handle non-existant features…
In SDL, it does it for you! :slight_smile:

I think gamma should work the same way… If you ask SDL, it will tell
you if the current mode/vidcard/whatever supports gamma, but if you tell
it to do gamma correction, it should do so, despite a possible speed
penalty… (the speed penalty shouldn’t be much more than an extra blit,
as all the gamma calculations should be able to be computed and stored
in a lookup table.)

Maybe one minor change to add for SDL 1.5/2.0?

Just my 2 cents,

-LorenOn Wed, 2002-09-25 at 11:28, DrEvil wrote:

On Wed, 2002-09-25 at 10:59, Patrice Mandin wrote:

Hello,

I would like to know what kind of gamma support must be present in the
video drivers.

I don’t believe SDL requires it to be implemented. Generally just a
message stating it’s not supported is sufficient.

It seems this as something to do with SDL_HWPALETTE. In the two video
drivers, I always set it (even in TrueColour modes). Is it wrong ?

Yes.

Does SDL_HWPALETTE should be set only when bpp<=8, and modify the real
palette video registers ?

Yes, that’s correct.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment