Hi,

I have a SDL application where I have to replace color of specified pixels.
So, I have a color in RGB representation and convert it to the pixel color
using that approach:

Uint32 PixelSrc = (0 << PF->Rshift) | (128 << PF->Gshift) | (192 <<
PF->Bshift);

But as result I get color 0x10c0 instead of 0x0080C0. Why it's happens? Does
SDL pixel format take into account byte order?

Moreover, I found following values for Xshift for little endian:

const int rshift = 0, gshift = 8, bshift = 16, ashift = 24;

Using them I can get correct pixel color:

Uini32 PixelDest = (0 << rshift) | (128 << gshift) | (192 << bshift);

But the byte order is different. I get 0xc08000 but it should be 0x0080c0.
Any idea what I do wrongly?

TIA

-- 
Cheers,
Michael
_______________________________________________
maemo-developers mailing list
[email protected]
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to