On Mon, Jul 13, 2009 at 10:00 PM, Elliott Slaughter <
elliottslaugh...@gmail.com> wrote:

> The information I get after using load-and-convert-image seems
> contradictory:
>
> bytes-per-pixel 4
> rmask 0x00FF0000
> gmask 0x0000FF00
> bmask 0x000000FF
> amask 0x00000000
>
> Why is the alpha mask 0 if it is 4 bytes per pixel?
>
> If I try load-and-convert-image on my png image, SDL still switches to BGRA
> ordering, but if I am careful, I can get the image to display properly
> (since it keeps the alpha channel). The pastebin code above gives me a blue
> image instead of a red one here :-)
>

Having thought about it a little more, here is my guess:

SDL seems want the image to be BGRA, even though the source didn't have an
alpha channel. So it adds an alpha channel and leaves a mask of 0. When I
put the image into Open GL, 0 alpha is interpreted as transparent.

When I hard code BGR ordering and 3 bytes per pixel, I do get something
drawn on the screen (but it's just a jumble of color). So maybe all of the
data is there, it just has this empty alpha byte for every pixel?

Now how would I test this/fix it?

-- 
Elliott Slaughter

"Don't worry about what anybody else is going to do. The best way to predict
the future is to invent it." - Alan Kay
_______________________________________________
application-builder mailing list
application-builder@lispniks.com
http://www.lispniks.com/mailman/listinfo/application-builder

Reply via email to