Jump to content
  • Advertisement
Sign in to follow this  
Ksingh30

newbi question

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

ok I have a class that loads a mesh from .X and in this class Im making this call hr = D3DXLoadMeshFromX( "big.x", D3DXMESH_MANAGED, _device, &adjBuffer, &mtrlBuffer, 0, &numMtrls, &Mesh); so what would be the bestway to pass in the name of the .Xfile for instance in this case it would ave to be "big.x" but I want to be able to pass in the file name. how do I do that, Thank You

Share this post


Link to post
Share on other sites
Advertisement
ok then What would I put in this
hr = D3DXLoadMeshFromX(
"big.x",
D3DXMESH_MANAGED,
_device,
&adjBuffer,
&mtrlBuffer,
0,
&numMtrls,
&Mesh);

for the file name. do I do it like this?
hr = D3DXLoadMeshFromX(
mesh.Load("big.x");
D3DXMESH_MANAGED,
_device,
&adjBuffer,
&mtrlBuffer,
0,
&numMtrls,
&Mesh);
??? sorry for such noob questions

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
...just detailing what ussnewjersey4 said:

void LoadMesh(LPSTR filename)
{
...

hr = D3DXLoadMeshFromX(
filename,
D3DXMESH_MANAGED,
_device,
&adjBuffer,
&mtrlBuffer,
0,
&numMtrls,
&Mesh);

...
}

And inside the initialization code you call:

LoadMesh("mesh1.x");
LoadMesh("mesh2.x");
LoadMesh("mesh3.x");
etc...

Share this post


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

  • 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!