CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Strange... :P

  1. #1
    Join Date
    Feb 2007
    Posts
    62

    Strange... :P

    I get errors while compileing stateing that an error ocurs in this particular part of code:
    Code:
    m_pDevD3D->SetVertexShader(D3DFVF_SIMPLEVERTEX);
    where D3DFVF_SIMPLEVERTEX is defined like this:
    Code:
    #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.

  2. #2
    Join Date
    Feb 2002
    Posts
    4,640

    Re: Strange... :P

    What is the compile error?

    Viggy

  3. #3
    Join Date
    Aug 2001
    Location
    Texas
    Posts
    645

    Re: Strange... :P

    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"

  4. #4
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656

    Re: Strange... :P

    Quote Originally Posted by sakurazuka
    ...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.
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinWindows - replacement windows manager for Visual Studio, and more...

  5. #5
    Join Date
    Feb 2007
    Posts
    62

    Red face Re: Strange... :P

    Quote Originally Posted by VladimirF
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured