Michael Stepanov wrote:

>     int bpp = surface->format->BytesPerPixel;

You can check also other fields of SDL_PixelFormat structure to get 
R,G,B color components. Interesting field names are

        Uint8  Rloss;
        Uint8  Gloss;
        Uint8  Bloss;
        Uint8  Rshift;
        Uint8  Gshift;
        Uint8  Bshift;
        Uint32 Rmask;
        Uint32 Gmask;
        Uint32 Bmask;

Or you can use SDL_GetRGB(Uint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, 
Uint8 *g, Uint8 *b) function which will probably do the dirty bit 
shifting and masking work for you.

http://www.google.com/search?q=SDL_GetRGB
_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to