XNA Math Version 2.04

The February 2011 release of the Xbox 360 XDK includes a new version of XNA Math, version 2.04. We are making it available here for Windows developers. The update is subject to the same EULA as the DirectX SDK (June 2010) release.

What’s New

XNA Math version 2.04 includes:

  • Addition of new data types and associated load-store functions:
    • XMLoadByteN2, XMLoadByte2, XMLoadUByteN2, XMLoadUByte2
    • XMStoreByteN2, XMStoreByte2, XMStoreUByteN2, XMStoreUByte2
    • XMLoadSInt2, XMLoadUInt2, XMLoadSInt3, XMLoadUInt3, XMLoadSInt4, XMLoadUInt4
    • XMStoreSInt2, XMStoreUInt2, XMStoreSInt3, XMStoreUInt3, XMStoreSInt4, XMStoreUInt4
  • Marked most single-parameter C++ constructors with ‘explicit’ keyword
  • Corrected range issues with SSE implementations of XMVectorFloor and XMVectorCeiling
  • Resolved a boundary issue with XMLoadShort* and XMLoadByte* that previously triggered an assert on values -32768 / -128

Release Notes

  • Due to a bug in optimizations done by the Visual Studio 2010 C/C++ compiler, some XNA Math functions will not work properly when used with _XM_NO_INTRINSICS_. This bug only appears at full optimization settings (/Ox) for Windows 32-bit, and may appear at any optimization setting for Windows 64-bit (x64). This issue does not impact the SSE2 intrinsic version of the XNA Math functions. This issue is fixed in Visual Studio 2010 Service Pack 1.

Update: There is a newer revision of this math library available as part of the Windows 8.0 SDK and Visual Studio 11 Beta known as “DirectXMath“. You can think of it as “XNAMath version 3.x”. It is very similiar although it does have a number of ‘breaking’ changes (there’s a migration guide as well), requires Visual Studio 2010 or later, and is not available for the Xbox 360. If you need to maintain compatibility with the Xbox 360 version in the XDK or VS 2008, you should continue to use XNAMath version 2.x.

GitHub: Note that DirectXMath is now hosted on GitHub.


Comments (7)

  1. Yuri says:

    It's a pitty, that there is no date for a new release of the DX-SDK. Our team has found a strange bug within XAudio. If you want to know more about that, please post it here and I'll contact you.

  2. Aessio T says:

    Why MS deleted all the xna math 2.0x msdn library reference? Ok, there is the new directxmath, aka xna math 3.0x, but how about people that need the old documentation? :

  3. walbourn says:

    Aessio – The libraries are generally pretty close, so you don't generally need the old docs. You can get them in the DirectX SDK (June 2010) in the offline documentation file if you really need them.

    Generally people should be using the DirectXMath version instead of XNAMath. It really only makes sense for folks writing for Xbox 360 or having to stick with VS 2008 for some reason (in which case see XNAMath 2.05). You can use DirectXMath for VS 2010 or VS 2012, Windows Store Apps, and Win32 desktop apps for Windows Vista, Windows 7, and Windows 8. Really if you needed to, you could even use it for Windows XP but you'd have to copy the files into your path since the "110_xp" Platform target for VS 2012 is otherwise using the Windows 7.1 SDK headers.

    Our of curiosity, why are you still using XNAMath instead of DirectXMath?

  4. Alessio T says:

    Thx for the replay.

    I started learning some D3D tutorial that use XNA Math, but now I decided to convert them to DirectXMath as "homework", so that's not a big deal as you wrote :p

  5. Simula says:

    In XNA Math you can create vertexes using XMFLOAT3 how do you that in DirectXMath?

  6. walbourn says:

    DirectXMath also has XMFLOAT3. It's just in a C++ namespace now.

  7. DollackMedia Usa, NA says:

    Real works always found due required invention.

    – 'stay true jcrue.'