[SDL] aalineRGBA problem

clemens kirchgatterer everslick at gmail.com
Tue Jun 13 04:39:53 PDT 2006


> > I suggest you skip the alpha stuff unless you need it and use
> > SDL_DisplayFormat to get an image suitable for blitting.
> > You're using ABGR, which on little endian machines happens to be what
> > the opengl wants (big endiand RGBA), but using that to blit
> > on screen in 2D is probably not what you're looking for, because I'm
> > betting you're display surface has something other than ABGR
> > (could it be ARGB?).
>
> Sorry ... I don't understand fully the concept behind these RGBA masks.

the RGBA mask defines where in a single pixelvalue the different color
channels get stored. this means, for example, if you are in a 32 bit mode,
one pixel is stored in a 32 bit integer and each color of RGBA use 8 bits.

pixel = 00101001 00101111 10101011 00011100

if the masks are set as follwing:

amask = 0xff000000
rmask = 0x000000ff
gmask = 0x0000ff00
bmask = 0x00ff0000

then the MSB holds the alpha value of the pixel and the LSB the red
colour channel. you get the idea?

hope this helps ...
clemens




More information about the SDL mailing list