On 28 August 2010 23:35, Misha Koshelev misha680@gmail.com wrote:
One point of clarification if possible.
The need for D3DXFVFFromDeclarator() from the standpoint ID3DXMesh is for the GetFVF() function.
It seems, per dlls/d3d9/tests/vertexdeclaration.c test_decl_to_fvf that the same functionality (to return an FVF from a device) exists in d3d9 as well.
Possibly. If you look at the tests in (d3d9) test_fvf_decl_conversion() you'll see that only the first two declarations return anything other than 0 (D3DFVF_XYZ and D3DFVF_XYZRHW), and those are marked as todo_wine. This is "implemented" by vertexdeclaration_init() *not* setting convFVF, and IDirect3DDevice9Impl_GetFVF() returning "decl->convFVF" when a vertex declaration is set. So declarations created by the application will always have 0 for FVF, while the ones created by getConvertedDecl() will have a non-zero FVF associated. It may well be the case that the test is simply flawed; I wouldn't call any of the declarations that return a 0 FVF reasonable. Most of them don't include position data, and the ones that do can't be expressed as an FVF at all. Nevertheless, the simple fact is that d3d9 doesn't currently implement conversion of vertex declarations to FVFs.