----Message d'origine----
De: Stefan Dösinger stefandoesinger@gmx.at A: wine-devel@winehq.org Date: Thu, 24 Nov 2005 10:14:51 +0100 Copie à: Oliver Stieber oliver_stieber@yahoo.co.uk Sujet: WINED3DFMT_R5G6B5 - is it RGB or BGR
Hello, While trying to get Moto Racer 2 running(old D3D1 game), I came across a problem with WINED3DFMT_R5G6B5. The game requests a 16 Bit surface, in RGB order. I translate this to WINED3DFMT_R5G6B5.
In some places, this format is translated to an RGB format, like in utils.c::D3DFmt2GLIntFmt, in an other function it is translated to a BRG format( utils.c::D3DFmt2GLFmt). The BRG format causes a failure in glReadPixels with the radeon driver(and broken textures) and swapped blue and red colors with fglrx. I modified D3DFmt2GLFmt to return RGB, and now everything works.
Is WINED3DFMT_R5G6B5 supposed to be RGB or BRG?
it should be RGB (as naming suppose) as majority of D3D formats . But OpenGL usually prefer use of BGR, so initially i use transformed formats. Note: we must add a check if cg support GL_RGB and/or GL_BGR formats and modify the code to adapt formats
Regards, Raphael
PS: it's not BRG but BGR :)
Hello,
it should be RGB (as naming suppose) as majority of D3D formats . But OpenGL usually prefer use of BGR, so initially i use transformed formats. Note: we must add a check if cg support GL_RGB and/or GL_BGR formats and modify the code to adapt formats
What about the other formats there, like WINED3DFMT_R3G3B2?
Should I send a patch(or can you send one) to change these values to GL_RGB? The GL_BGR color value breaks this kind of surfaces.
Stefan
--- Stefan Dösinger stefandoesinger@gmx.at wrote:
Hello,
it should be RGB (as naming suppose) as majority of D3D formats . But OpenGL usually prefer use of BGR, so initially i use transformed formats. Note: we must add a check if cg support GL_RGB and/or GL_BGR formats and modify the code to adapt formats
What about the other formats there, like WINED3DFMT_R3G3B2?
Should I send a patch(or can you send one) to change these values to GL_RGB? The GL_BGR color value breaks this kind of surfaces.
the 565 format needs correcting but I think the other colours are correct, at least the 888 oned and 1555 texture formats.
Ghost recon is also affected by this http://bugs.winehq.org/show_bug.cgi?id=3779
Oliver.
Stefan
___________________________________________________________ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com