Get ID3DXAnimationController from D3DXLoadMeshHierarchyFromX without D3D Device?

Started by
1 comment, last by Carradine 12 years ago
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.

--------------------------Vantage: Greenlit on Steam / Independent Games Festival Submission http://www.crystaldragon.com

Advertisement
You can create a NULL device for this sort of thing. Just pass D3DDEVTYPE_NULLREF when creating the device.
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.

--------------------------Vantage: Greenlit on Steam / Independent Games Festival Submission http://www.crystaldragon.com

This topic is closed to new replies.

Advertisement