Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

LittleFreak

Getting an undeclared identifier Error can anyone help

This topic is 5245 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The issue comes up when I try to test intersect. Both of my errors come up in that. My intersect code is: float cNodeTreeMesh::GetHeightAbove(float XPos, float YPos, float ZPos) { BOOL Hit; float u, v, Dist; DWORD FaceIndex; D3DXIntersect(m_Mesh->m_Mesh, &D3DXVECTOR3(XPos,YPos,ZPos), &D3DXVECTOR3(0.0f, 1.0f, 0.0f), &Hit, &FaceIndex, &u, &v, &Dist, LPD3DXBUFFER &ppAllHits, DWORD &pCountOfHits); if(Hit == TRUE) return YPos+Dist; return YPos; } The errors I am getting is : C:\NodeTree.cpp(374) : error C2065: ''ppAllHits'' : undeclared identifier C:\NodeTree.cpp(374) : error C2275: ''LPD3DXBUFFER'' : illegal use of this type as an expression c:\dxsdk\include\d3dx8core.h(30) : see declaration of ''LPD3DXBUFFER'' C:\NodeTree.cpp(374) : error C2065: ''pCountOfHits'' : undeclared identifier C:\NodeTree.cpp(374) : error C2275: ''DWORD'' : illegal use of this type as an expression c:\program files\microsoft visual studio\vc98\include\windef.h(141) : see declaration of ''DWORD'' Any ideas i mean its almost an exact copy of what the SDK says for intersect. Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
You can''t declare new variables inside a function call.

This part:
D3DXIntersect(m_Mesh->m_Mesh,
&D3DXVECTOR3(XPos,YPos,ZPos),
&D3DXVECTOR3(0.0f, 1.0f, 0.0f),
&Hit, &FaceIndex, &u, &v, &Dist, LPD3DXBUFFER &ppAllHits, DWORD &pCountOfHits);

Should be changed to:

LPD3DXBUFFER ppAllHits;
DWORD pCountOfHits;

D3DXIntersect(m_Mesh->m_Mesh,
&D3DXVECTOR3(XPos,YPos,ZPos),
&D3DXVECTOR3(0.0f, 1.0f, 0.0f),
&Hit, &FaceIndex, &u, &v, &Dist, &ppAllHits, &pCountOfHits);

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!