Math Functions

Note  The math functions of the D3DX utility library are deprecated for Windows 8. We recommend that you use DirectXMath instead.

The math library provided by the D3DX utility library supplies functions to compute 3D mathematical operations. Each of the functions can take the same object as the passed [in] and returned [out] parameters. Also, out parameters are typically returned as return values, so that the output of one math function can be used as a parameter for another math function.

Resolving Link Errors with D3DX Math Functions

The D3DX math functions are implemented identically in D3DX10 (D3DX10math.h) and D3DX9 (D3DX9math.h). This can cause link errors if a project implements both DirectX 9 and DirectX 10 code, and attempts to link a function from one header with the opposite library.

To eliminate the problem of including both headers, D3DX10math.h includes the following #define:



#ifndef __D3DX9MATH_H__
#define __D3DX9MATH_H__


To eliminate possible link errors, the DX SDK samples link to D3DX9 libraries first (D3DX9d.lib and D3DX9.lib) and then the D3DX10 libraries second (D3DX10d.lib and D3DX10.lib). These settings are under Project/Properties if you are using Visual Studio.

 

 

Community Additions

ADD
Show:
© 2014 Microsoft