In article <br*********@news3.tilbu1.nb.home.nl>,
no*@listed.com says...
[ ... ]
Using casting, is there any way to cast forward and backward from my own
classes to and from the microsoft d3dx classes?
I'm not sure about "forward and backward", but it's certainly possible
to support conversion between the two types. Normally, you'll want to
support conversion from their type to yours by writing a ctor that takes
an object of their type as a parameter.
Conversion from their type to yours is done by writing a cast operator
in your class that does whatever is needed to covert your data to their
format. A really simple case could be done like this:
class Integer {
int val;
public:
Integer(int init) : val(init) {}
operator int() { return val; }
};
This supports implicit conversions from int to Integer via the ctor, and
from Integer to int via the cast operator. In your case, it sounds like
the conversion may easily be more complex, but from the sound of things,
I'm guessing you already know about how to get the data from one to the
other so I'll leave that alone for now (besides, it probably wouldn't be
topical here anyway).
--
Later,
Jerry.
The universe is a figment of its own imagination.