Games for Windows and the DirectX SDK blog

Technical tips, tricks, and news about game development for Microsoft platforms including desktop, Xbox, and UWP


Project maintained by walbourn Hosted on GitHub Pages — Theme by mattgraham
Home | Posts by Tag | Posts by Month

XNA Math Version 2.04

xnamath, directxmath

Originally posted to Chuck Walbourn's Blog on MSDN,

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:
    • XMBYTEN2, XMBYTE2, XMUBYTEN2, XMUBYTE2
    • XMLoadByteN2, XMLoadByte2, XMLoadUByteN2, XMLoadUByte2
    • XMStoreByteN2, XMStoreByte2, XMStoreUByteN2, XMStoreUByte2
    • XMINT2, XMUINT2, XMINT3, XMUINT3, XMINT4, XMUINT4
    • 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 under the MIT license

XNAMath_204.zip