Click to See Complete Forum and Search --> : Strange... :P
sakurazuka
June 1st, 2007, 11:44 AM
I get errors while compileing stateing that an error ocurs in this particular part of code:
m_pDevD3D->SetVertexShader(D3DFVF_SIMPLEVERTEX);
where D3DFVF_SIMPLEVERTEX is defined like this:
#define D3DFVF_SIMPLEVERTEX (D3DFVF_XYZRHW|D3DFVF_DIFFUSE)
Which is, as I'm perciving it, strange because in a similiar project some guy is using exactly the same command and the compiler isn't throwing any error messages about incapabilities of casting from int to *pShader. So I'm guessing he's running it with other cmd line options but I don't really know.
Thanks in advance.
MrViggy
June 1st, 2007, 12:12 PM
What is the compile error?
Viggy
cvogt61457
June 1st, 2007, 12:25 PM
Please use a title that is meaningful to the topic.
"Strange..." has no meaning.
Many people won't look at these questions.
Something like "Compiler error with graphics library"
VladimirF
June 1st, 2007, 02:07 PM
...because in a similiar project some guy is using exactly the same command and the compiler isn't throwing any error messages about incapabilities of casting from int to *pShader. So I'm guessing he's running it with other cmd line options but I don't really know.
How about different version of DirectX?
From MSDN:
Vertex Declaration Changes
Vertex declarations are now decoupled from vertex shader creation. Vertex declarations now use a Component Object Model (COM) interface.
For DirectX 8.x, vertex declarations are tied to vertex shaders.
- For the fixed function pipeline, call IDirect3DDevice9::SetVertexShader with the flexible vertex format (FVF) code of the vertex buffer.
- For vertex shaders, call IDirect3DDevice9::SetVertexShader with a handle to a previously create vertex shader. The shader includes a vertex declaration.
For Direct3D 9, vertex declarations are decoupled from vertex shaders and they can be used with either the fixed function pipeline or with shaders.
- For the fixed function pipeline, there is no need to call IDirect3DDevice9::SetVertexShader. If, however, you want to switch to the fixed function pipeline and have previously used a vertex shader, call IDirect3DDevice9::SetVertexShader(NULL). When this is done, you will still need to call IDirect3DDevice9::SetFVF to declare the FVF code.
- When using vertex shaders, call IDirect3DDevice9::SetVertexShader with the vertex shader object. Additionally, call IDirect3DDevice9::SetFVF to set up a vertex declaration. This uses the information implicit in the FVF. IDirect3DDevice9::SetVertexDeclaration can be called in place of IDirect3DDevice9::SetFVF because it supports vertex declarations that cannot be expressed with an FVF.
sakurazuka
June 4th, 2007, 11:20 AM
How about different version of DirectX?
Heh... I guess It would help. I forgot that that 'other guy' was using DirectX 8 while I'm trying to get it running in DirectX 9. I guess what you wrote after that will make it work. Thanks.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.