Jump to content
  • Advertisement
Sign in to follow this  
Carradine

Get ID3DXAnimationController from D3DXLoadMeshHierarchyFromX without D3D Device?

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

Hello, I am currently expanding my program to a client/server system, and I an looking to see if I can extract the ID3DXAnimationController information from a file without creating a D3D Device?

On the pure client version everything works fine, however on my new server where I disable all D3D rendering, the call fails.

I simply want to access my animation timing data in my .x files for server purposes.

I simply use this line:



hr = ( D3DXLoadMeshHierarchyFromX( VGlobal::CURRWORKDIR + VGlobal::CurrMeshDir + smName, D3DXMESH_MANAGED, g_pd3dDevice,
&Alloc, NULL, &g_pFrameRoot, &g_pAnimController ) );


And when g_pd3dDevice is NULL, the call fails.

This is the function I am trying to call:



ID3DXAnimationSet * animationSet = NULL;

if( g_pAnimController != NULL )
{
if( g_pAnimController->GetAnimationSet( animSetID, &animationSet ) == S_OK )
{
int tAnim = int(animationSet->GetPeriod() * 1000);
SAFE_RELEASE( animationSet );
return tAnim;
}
}


Thanks.

Share this post


Link to post
Share on other sites
Advertisement
You can create a NULL device for this sort of thing. Just pass D3DDEVTYPE_NULLREF when creating the device.

Share this post


Link to post
Share on other sites
Yep that works thanks! That is what I was looking for. I was looking to see if there was a way to avoid the D3D Device allocation, but its not a big deal.

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!