Newbie confused with SDL Palette
First, I''m running SDL but ( vomit on the keyboard ) the Windows version. I ask my question on the Linux board because I think that''s the board the most knowledgeable about SDL.
I was able to have a simple program ploting a pixel on a palettized ( 8bpp )surface.
AsI understant I have to "attach" the 256 SDL_Color array to the surface and I did that using the SDL_SetColors ( that worked ) .
Now I tried using the SDL_SetPalette function and it works too.
Could someone please be kind enougf what''s the exact difference between the 2 functions and in what specific case I shoild use one or the other
Thanks in advance for any tip, info or opinion
P.S. my next goal will be to run the SDL Linux version
Well, i don''t know the answer, but SDLDoc does!
To quote, "Palettized (8-bit) screen surfaces with the SDL_HWPALETTE flag have two palettes, a logical palette that is used for mapping blits to/from the surface and a physical palette (that determines how the hardware will map the colors to the display). SDL_SetColors modifies both palettes (if present), and is equivalent to calling SDL_SetPalette with the flags set to (SDL_LOGPAL | SDL_PHYSPAL)."
Very useful website.
By the way, if sdldoc doesn''t help, or if you have other questions, you can always join us on irc at irc.openprojects.net on #sdl.
ben.c
To quote, "Palettized (8-bit) screen surfaces with the SDL_HWPALETTE flag have two palettes, a logical palette that is used for mapping blits to/from the surface and a physical palette (that determines how the hardware will map the colors to the display). SDL_SetColors modifies both palettes (if present), and is equivalent to calling SDL_SetPalette with the flags set to (SDL_LOGPAL | SDL_PHYSPAL)."
Very useful website.
By the way, if sdldoc doesn''t help, or if you have other questions, you can always join us on irc at irc.openprojects.net on #sdl.
ben.c
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement