Jump to content
  • Advertisement
Sign in to follow this  
UncleBob

initializing an LPD3DVECTOR

This topic is 3501 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well, this one is pretty quick and dirty, but I didn't succeed in solving it myself. All I'm trying is to get the position of my camera in direct3d (C++), and for that I need an LPD3DVECTOR... sure, no problem. I define one at the beginning of my function. But the camera.GetPosition(LPDIRECT3DRMFRAME3 reference, LPD3DVECTOR return-position) wants the vector allready initialised. I know how to initialise standard datatypes, but how do I initialise a LPD3DVECTOR? simply initialising it with NULL doesn't help, the SDK documentation refused to be of much help and I didn't find the problem on the net either. I guess it's really a trivial problem anyone with an apropriate bit of C++ expirience knows how to deal with, but alas my expirience so far is limited to visual basic, wich didn't exactly teach me much about initialising, pointers etc.

Share this post


Link to post
Share on other sites
Advertisement
LPD3DVECTOR is defined as a pointer (*) to a D3DVECTOR3 structure.
You can declare a variable which has the structure type:

D3DVECTOR3 vec;


and use the address-of operator (&) to get a pointer to that:

camera.GetPosition(reference, &vec);


EDIT: like SiCrane said.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!