Jump to content
  • Advertisement
Sign in to follow this  
Adaline

Migrating from D3DX to DirectXMath

This topic is 2126 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

Hello

 

Since I use Windows 8, D3DX isn't available anymore and it is adviced to use DirectXMath instead 

 

in the header DirectXMath.h there's the line :

XMVECTOR    operator- (FXMVECTOR V1, FXMVECTOR V2);

so I try to use it  :

void blah(DirectX::FXMVECTOR v1,DirectX::FXMVECTOR v2)
{
	v1-v2;
}

But I get an error ...

('DirectX::FXMVECTOR' does not define this operator or a conversion to a type acceptable to the predefined operator)

... on the - operator wacko.png  and honestly I don't understand why and it makes me crazy angry.png  ...

 

Please what's the problem here ?

Edited by Tournicoti

Share this post


Link to post
Share on other sites
Advertisement

Function is hidden inside namespace, therefore you'll have to use one of these:

using namespace DirectX;
// or
using DirectX::operator-;
Edited by Zaoshi Kaba

Share this post


Link to post
Share on other sites

 

Function is hidden inside namespace, therefore you'll have to use one of these:

using namespace DirectX;
// or
using DirectX::operator-;

Hello. Indeed you're right, but since I'm in a header (inline class) I don't want to use " using namespace ..." smile.png 

 

your second option :

using DirectX::operator-; 

works fine. Thank you

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!