|
Prev: how to declare ptr to vector as part of a class definition
Next: My Edit boxes are flickering when CView object is redrawing itself.
From: Jack on 9 May 2008 04:36 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 9 May 2008 04:41 > 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 9 May 2008 05:12 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 9 May 2008 05:21 And the compiler seems to refuse the conversion.. Thanks Jack
From: Jack on 9 May 2008 05:24
I've solved it, but the data preservation question still persists |