Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualNightCreature83

Posted 30 April 2012 - 01:43 AM

Your problem lies in this
#define D3DFVF_CUSTOMVERTEX(D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1 )
This is not a properly defined FVF.

SetFVF takes a DWORD as it's parameter not a define.
//From the DX SDK documentation
HRESULT SetFVF(
  [in]  DWORD FVF
);
And if you would look at the examples they use in the documentation you see that they all use "const DWORD" variables to define the custom vertex format.
The better way of doing this is to use a vertexdeclaration, which will allow you to use shaders properly as well and will make the switch from DX9 to higher much easier to achieve as the fixed function pipeline is dead.

#2NightCreature83

Posted 30 April 2012 - 01:43 AM

Your problem lies in this
#define D3DFVF_CUSTOMVERTEX(D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1 )[
/code]
This is not a properly defined FVF.

SetFVF takes a DWORD as it's parameter not a define.
[code]
//From the DX SDK documentation
HRESULT SetFVF(
  [in]  DWORD FVF
);
And if you would look at the examples they use in the documentation you see that they all use "const DWORD" variables to define the custom vertex format.
The better way of doing this is to use a vertexdeclaration, which will allow you to use shaders properly as well and will make the switch from DX9 to higher much easier to achieve as the fixed function pipeline is dead.

#1NightCreature83

Posted 30 April 2012 - 01:41 AM

Your problem lies in this
[color="#880000"]#define[/color][color="#000000"] D3DFVF_CUSTOMVERTEX [/color][color="#666600"]([/color][color="#000000"]D3DFVF_XYZ [/color][color="#666600"]|[/color][color="#000000"] D3DFVF_NORMAL [/color][color="#666600"]|[/color][color="#000000"] D3DFVF_TEX1 [/color][color="#666600"])[/color]

SetFVF takes a DWORD as it's parameter not a define.
//From the DX SDK documentation
HRESULT SetFVF(
  [in]  DWORD FVF
);
And if you would look at the examples they use in the documentation you see that they all use "const DWORD" variables to define the custom vertex format.
The better way of doing this is to use a vertexdeclaration, which will allow you to use shaders properly as well and will make the switch from DX9 to higher much easier to achieve as the fixed function pipeline is dead.

PARTNERS