SetGammaRamp

Hello,

being quite a beginner in C, it would be great if somebody here could help
me. I would like to know how the SetGammaRamp function on the VideoDevice
is working. I found the SDL_VideoDevice struct in SDL_sysvideo.h and the
int (*SetGammaRamp)(_THIS, Uint16 *ramp). But where is the function
belonging to this pointer implemented? I could not find it. Can sombody
please give me a hint?!

Thanks

Sebastian

I’ve never looked at the gamma-related stuff in SDL, but in any case,
the man page for the function might be useful. If you don’t have the
man pages, a quick Google search helps. Here’s a link:

http://linux.die.net/man/3/sdl_setgammarampOn Sat, Nov 07, 2009 at 11:06:38PM +0100, Sebastian Elsner wrote:

being quite a beginner in C, it would be great if somebody here could help
me. I would like to know how the SetGammaRamp function on the VideoDevice
is working. I found the SDL_VideoDevice struct in SDL_sysvideo.h and the
int (*SetGammaRamp)(_THIS, Uint16 *ramp). But where is the function
belonging to this pointer implemented? I could not find it. Can sombody
please give me a hint?!


-bill!
Sent from my computer

SDL is a C library, so it doesn’t have access to fancy OOP stuff like
inheritance and vtables. The precursor to virtual functions was just
to have a pointer to a function stored in a struct.

Ultimately everything in SDL is about abstracting the hacker away from
hardware-specific code so that they can write to a single API. You can
think of the SDL_VideoDevice struct as a “pure virtual base class” in
C++, or an “interface” in Java.

The implementations/sub-classes of SDL_VideoDevice can be found in
SDL/src/video/*/SDL_*video.c and that’s where you’ll find the
functions that get called when you call SDL_SetGammaRamp().

Using Google Codesearch to search SDL 1.2.7 you can see many results
very quickly:

http://google.com/codesearch?hl=en&sa=N&filter=0&q=SetGammaRamp+package:"http://ftp.osuosl.org/pub/nslu2/sources/SDL-1.2.7.tar.gz"

I recommend learning to use “grep” though since Codesearch can be kind
of a PITA to use all the time.On Sat, Nov 7, 2009 at 6:06 PM, Sebastian Elsner wrote:

I would like to know how the SetGammaRamp function on the VideoDevice is
working. I found the SDL_VideoDevice struct in SDL_sysvideo.h and the int
(*SetGammaRamp)(_THIS, Uint16 *ramp). But where is the function belonging to
this pointer implemented? I could not find it.


http://codebad.com/