I have some questions about the format of a pixel used by different modes:
-
in 8 bbp, does the SDL_MapRGB() searches for an entry into the palette
similar to the requested color and returns its color number into the
palette? Writing a number of a color into a pixel seems infact to work… -
in 16bpp mode, shouldn’t the three components be respectively 5, 6 and 5
bits wide? if so, does SDL make a conversion, translating them in 8bit
values? I tried to write 255, 255, 255 to obtain white, and I got, but the
actual colors written (or, at least, the ones returnet by SDL_GetRGB() )
were 248, 252, 248( printing the color Uint32 value, i gor 65535, and this
is right…). How does all this work? -
In a 16bit file, aren’t the components stored using 5, 6 and 5 bits for
the 3 components? How should I deal with is, building my own loading
functions? -
What are RGB shift, mask and loss, into the format structure, used for?
-
Finally, how are the various modes managed? I mean: determining the
color, the pitch, how the various bits are packet into one ore more bytes
(i.e: 12bpp mode, 15 bpp mode…), conversions during blits, etc…
Thanx a lot… (the docs don’t contain anything about this stuff, and
making experiments and watching code examples is not enough…)
Marco Iannaccone @Marco_Iannaccone
ICQ: 18748121 Tolkien
“I’ve… seen things you people wouldn’t believe. Attack ships on fire off
the shoulder of Orion.
I watched C-beams… glitter in the dark near the Tanhauser Gate. All
those… moments will be lost… in time…, like… tears… in… rain.”
FAQ it.comp.lang.c: http://www.programmazione.it/linguaggi/c/itcomplangc.htm
FAQ it.comp.lang.c++: http://www.programmazione.it/linguaggi/c/lang_faq.htm