Members - Reputation: 129
Posted 19 August 2012 - 01:18 AM
Via DX10 I use the R8G8B8A8_UNorm format, works perfectly fine. Via GL2 I use GL_RGBA. Also works perfectly fine.
However with DX9 I either use A8R8G8B8 and the colors are reversed(b = r, r = b) or I use A8B8G8R8 and have it crash. According to MSDN they are identical to each other:
The debug error messages are:
Direct3D9: (ERROR) :Invalid format specified for texture
Direct3D9: (ERROR) :Failure trying to create a texture
The code to get the pixels is the same, and so is pretty much every other bit of code.
CheckDeviceFormat() returns false, so my question is why does the exact same format work in DX10 and OpenGL but is not supported in DX9? I have searched and I cannot find anything on google or MSDN that implies that A8B8G8R8 is a bad evil format to work with.