Ivan Gyurdiev ivg231 at
Wed Jul 5 01:49:46 CDT 2006

Stefan Dösinger wrote:
> WINED3DFMT_R8G8B8 means that the 8 most significant bits contain the red color 
> channel, and the 8 least significant ones the blue channel. But in memory the 
> least significant bits are at the highest address, so the surface ends up as 
> BGR in memory. This patch finally changes that after the surface format 
> cleanup has been done as requested by AJ.
> To my knowledge this format has been changed at least 3 times. Originally(in 
> old d3d8) it was GL_RGB as this seems most intuitive. Then Oliver noticed the 
> endianity problem and flipped it to GL_BGR, but incorrectly changed 
> WINED3DFMT_R5G6B6 too, which caused gl errors with the 16 bit format. Some 
> time later a patch for WINED3DFMT_R5G6B6 was sent which incorrectly changed 
> WINED3DFMT_R8G8B8 back to GL_RGB too. This patch only modifies 
> WINED3DFMT_R8G8B8 and leaves the other formats in peace :-)
And what about LockRect() ?

More information about the wine-devel mailing list