On 06/05/06, Ivan Gyurdiev ivg2@cornell.edu wrote:
[ applies on top of Mike's tree, but hopefully on the main tree too ]
R8G8B8 means red is the most significant bit. On a little-endian system, the texture is stored starting with blue. It is read byte-by-byte (GL_UNSIGNED_BYTE), therefore it needs to be flipped to GL_BGR.
This makes Demo #2 (texture mapping: http://www.zanir.szm.sk/dx00-09.html) show the correct colors. Also, in HL2, it makes Barney's face human color (previously it was blue). I think Stefan Dosinger saw improvement on some other demos.
There might be more to this. This was changed the other way around not too long ago. See http://source.winehq.org/git/?p=wine.git;a=commit;h=252c4adb965a26db19c1c916...
It might just be that the glDrawPixels call should've been changed instead last time. (Shouldn't those simply use the format in This->glDescription.glFormat in the first place?)