From: Jack on
Hello,

I am getting a little bit puzzled
There is a class in Direct3D called D3DXLoadMeshFromHierarchy
which takes a LPD3DXFRAME as the sixth
parameter.

And my question is
if I derived a new class with additional attributes
from D3DXFRAME say Derived_Frame

How can I make D3DXLoadMeshFromHierarchy
choose my derived class Derived_Frame instead of LPD3DXFRAME (Pointer to
D3DXFRAME)
? because It is fixed in the API and I don't think I can change the "MS"
stuff :)
I need to promote/demote any classes/member variables while calling the
function?

Thanks
Jack


From: Jack on
> Hello,
>
> I am getting a little bit puzzled
> There is a class in Direct3D called D3DXLoadMeshFromHierarchy
> which takes a LPD3DXFRAME as the sixth
> parameter.
>
> And my question is
> if I derived a new class with additional attributes
> from D3DXFRAME say Derived_Frame
>
> How can I make D3DXLoadMeshFromHierarchy
> choose my derived class Derived_Frame instead of LPD3DXFRAME (Pointer to
> D3DXFRAME)
> ? because It is fixed in the API and I don't think I can change the "MS"
> stuff :)
> I need to promote/demote any classes/member variables while calling the
> function?

Is this just as simple as this?
D3DXLoadMeshFromHierarchy (..., (LPD3DXFRAME*) &myvar);

>
> Thanks
> Jack
>


From: Jack on
Another question, if I demote a derived class to base class using
static_cast
static_cast<LPD3DXFRAME>m_pMesh->GetFrameRoot();

GetFrameRoot(); originally returns the derived class
Would data in the derived class preserved while other attributes are
discarded?

Thanks
Jack


From: Jack on
And the compiler seems to refuse the conversion..
Thanks
Jack


From: Jack on
I've solved it, but the data preservation question still persists