<div dir="ltr">Hi,<br><br>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:<br><br>Uint32 PixelSrc = (0 << PF->Rshift) | (128 << PF->Gshift) | (192 << PF->Bshift);<br>
<br>
But as result I get color 0x10c0 instead of 0x0080C0. Why it's happens? Does SDL pixel format take into account byte order?<br><br>Moreover, I found following values for Xshift for little endian:<br><br>const int rshift = 0, gshift = 8, bshift = 16, ashift = 24;<br>
<br>Using them I can get correct pixel color:<br><br>Uini32 PixelDest = (0 << rshift) | (128 << gshift) | (192 << bshift);<br><br>But the byte order is different. I get 0xc08000 but it should be 0x0080c0. Any idea what I do wrongly?<br>
<br>TIA<br clear="all"><br>-- <br>Cheers,<br>Michael<br>
</div>