[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SDL question



The 'pitch' is the length of each scanline of the image in bytes. So for an
8bpp image the pitch would usually be equal to the width, for a 16bpp image
the pitch would usually be width*2.

The [RGBA] masks specify how the colour components are packed. These are
ignored in 8-bit modes. A standard 32-bit surface would have masks like:

(Little Endian)
R: 0x000000ff
G: 0x0000ff00
B: 0x00ff0000
A: 0xff000000

(Big Endian)
R: 0xff000000
G: 0x00ff0000
B: 0x0000ff00
A: 0x000000ff

On Mon, Jan 29, 2001 at 08:41:43AM -0200, MAO wrote:
>     Anyone familiar with SDL, could you give me a help here? I've been
> working with GGI for some time, but now I want to port some of my
> applications to  SDL. How do I calculate the "pitch" to use with the
> SDL_CreateRGBSurfaceFrom, once I have an image loaded into a buffer, with
> it's width and height? And what are the R, G and B masks for, and how do I
> find out what are they?

-- 
Martin
--
Bother said Pooh, and pulled the detonator killing the dictator.

---------------------------------------------------------------------
To unsubscribe, e-mail: linuxgames-unsubscribe@sunsite.dk
For additional commands, e-mail: linuxgames-help@sunsite.dk