Re: DirectX API and my classes
"Jack" <jl@knight.com> ha scritto nel messaggio
news:OKlcB$asIHA.4876@TK2MSFTNGP02.phx.gbl...
I am getting a little bit puzzled
There is a class in Direct3D called D3DXLoadMeshFromHierarchy
which takes a LPD3DXFRAME as the sixth
parameter.
I think that D3DXLoadMeshFromHierarchy is a function (or method) but not a
class...
However, I failed to find documentation about that.
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
If LPD3DXFRAME is an output parameter, i.e. if the aforementioned function
"builds" an instance of D3D frame class (I think so), then you must use a
pointer of type LPD3DXFRAME, not a pointer to some derived class.
Moroever, I think that D3D uses COM for its components (COM interfaces), so
it might be that this LPD3DXFRAME is a pointer to some COM interface (like
ID3DXFrame...), and deriving classes from COM interfaces is not trivial (you
should derive a new interface from an existing COM interface, etc. ...)
Instead, you can define a new C++ class, and add a member variable of type
LPD3DXFRAME, and init that using the value returned as output parameter from
D3DXLoadMeshFrom...
class CMyFrame
{
...
//
// Init that pointer (data member) with
// the return value of
// D3DXLoadMeshFromHierarchy
//
LPD3DXFRAME m_pD3DXFrame;
...
other data members
...
};
HTH,
Giovanni