D3DXIntersect Error

Started by
5 comments, last by LittleFreak 19 years, 10 months ago
Im getting a error with visual studio 6 saying that D3DXIntersect doesnt take 8 parameters. Im using DX9sdk but programing in DX8 does that make a differnce. Any1 know whats wrong?
Advertisement
That function is implemented differently in the directX 9.0 sdk, look in both sdks for the parameters. If there is a different function prototype in any of them, try that one instead...
--m_nPostCount++
doing some research look through the SDKs it all has 10 parameter. But im using one of the premierpress books and it says:

HRESULT D3DXIntersect(
LPD3DBASEMESH pmesh,
CONST *D3DXVECTOR3(XPos,YPos,ZPos),
CONST *D3DXVECTOR3(0.0f, -1.0f, 0.0f),
BOOL *Hit,
DWORD *FaceIndex,
FLOAT *u,
FLOAT *v,
FLOAT *Dist);

But the SDK says

HRESULT WINAPI
D3DXIntersect(
LPD3DXBASEMESH pMesh,
CONST D3DXVECTOR3 *pRayPos,
CONST D3DXVECTOR3 *pRayDir,
BOOL *pHit,
DWORD *pFaceIndex,
FLOAT *pU,
FLOAT *pV,
FLOAT *pDist,
LPD3DXBUFFER *ppAllHits,
DWORD *pCountOfHits);

Is this book I payed $60 for and spent about 10 hours now reading all a bunch of BS?
Just tack ", NULL, NULL" on to the end of your parameter list. The last few params are for multiple intersections.
It looks like you''re doing a terrain mesh anyway so you probably won''t need that.
quote:
Im using DX9sdk but programing in DX8 does that make a differnce.


I''m still puzzled as to why people do this, short of having a video card that doesn''t support DX9. DX8 code can be moved to DX9 by changing a few interface names, and the rest shouldn''t need to be changed.

*boggle*

---------------------------Hello, and Welcome to some arbitrary temporal location in the space-time continuum.

quote:Original post by LittleFreak
doing some research look through the SDKs it all has 10 parameter. But im using one of the premierpress books and it says:

HRESULT D3DXIntersect(
LPD3DBASEMESH pmesh,
CONST *D3DXVECTOR3(XPos,YPos,ZPos),
CONST *D3DXVECTOR3(0.0f, -1.0f, 0.0f),
BOOL *Hit,
DWORD *FaceIndex,
FLOAT *u,
FLOAT *v,
FLOAT *Dist);

But the SDK says

HRESULT WINAPI
D3DXIntersect(
LPD3DXBASEMESH pMesh,
CONST D3DXVECTOR3 *pRayPos,
CONST D3DXVECTOR3 *pRayDir,
BOOL *pHit,
DWORD *pFaceIndex,
FLOAT *pU,
FLOAT *pV,
FLOAT *pDist,
LPD3DXBUFFER *ppAllHits,
DWORD *pCountOfHits);

Is this book I payed $60 for and spent about 10 hours now reading all a bunch of BS?
No - DirectX9 is not overly different to DirectX8. There are some changes to the parameter lists of some functions that you will doubtlessly come across (like D3DXIntersect) and stuff added that you may not come across for a while like the High Level Shader Language (HLSL). You can just see what you need from the SDK documentation. A lot of the time you just need to add a few NULL parameters to your function calls.

IMO you shouldn''t really use a function without trying to understand what it / each of it''s parameters does anyway.

quote:Original post by __Daedalus__
IMO you shouldn''t really use a function without trying to understand what it / each of it''s parameters does anyway.

For some people, it''s easier to dive head first then swim back to the top. They get to see the end result and get a sense of worth for what they''re about to try to understand. Makes the learning process much easier / faster.

I think going with the 8 SDK is a good thing if your book is going that way. But don''t use the 9-docs. Use the same docs as the version you''re using. Google for them.

This topic is closed to new replies.

Advertisement