• Advertisement
Sign in to follow this  

D3DXLoadMeshFromX

This topic is 4614 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

HRESULT WINAPI D3DXLoadMeshFromX( LPCTSTR pFilename, DWORD Options, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXBUFFER *ppAdjacency, LPD3DXBUFFER *ppMaterials, LPD3DXBUFFER *ppEffectInstances, DWORD *pNumMaterials, LPD3DXMESH *ppMesh ); 2 question. DWORD is small,so just use DWORD is ok.why use DWORD *? why can not convert int* to DWORD,I know the 2 type is almost same.

Share this post


Link to post
Share on other sites
Advertisement
If you are referring to why pNumMaterials is a pointer, it's because it is a pointer to information you want *from* the function. You are handing the function a pointer and saying "put the response in this location when you are done". The documentation for D3DXLoadMeshFromX explains in more detail.

As for your second question, a DWORD is NOT the same as a pointer to an integer. They may take up the same amount of storage, but they have very different meanings...you would not want to mix up the two by accident in your program as it would 99% of the time be a serious error, which is why the compiler will not automatically convert one to the other without an explicit cast from you.

I suggest you take a look at a few guides to brush up on your pointer knowledge:

http://www.augustcouncil.com/~tgibson/tutorial/ptr.html
http://www.cplusplus.com/doc/tutorial/tut3-3.html
http://richardbowles.tripod.com/cpp/cpp18.htm

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement