Windows Store DirectX Game Template

Free

A multi-project Windows Store app template for creating Windows Store DirectX games using Visual C++ and DirectXTK ( http://directxtk.codeplex.com/ ).

(0) Review
Visual Studio
2012
Download (8,998)
4/7/2013
1.1
View
E-mail Twitter del.icio.us Digg Facebook
Add to favorites
Description
Reviews
Q and A (1)
Sign in to write a review

Be the first to write a review.

Sign in to start a discussion


  • Minor bug in version 1.1
    1 Posts | Last post April 10, 2013
    • This will be fixed in the next version and most people are unlikely to run in to it but I wanted to post it here anyway.
      
      In MultipleConvertersConverter.h, in the ConvertBack member function on line 44, the code "for (auto i = m_converters->Size - 1; i >= 0; --i)" results in the type of "i" being "unsigned int". Since an unsigned int can never be less than zero, the result is an infinite loop.
      
      One solution (the one I'll be including with the next version) is to change line 44 to: "for (auto i = static_cast<long long>(m_converters->Size - 1); i >= 0; --i)" and then change line 46 to "auto converter = m_converters->GetAt(static_cast<unsigned int>(i));" in order to avoid the warning about a possible loss due to an implicit conversion from a 64 bit int to a 32 bit uint. Since the Size property is a 32 bit uint we know that we will not have lost any data here so the narrowing conversion is fine.
      
      Since most people never use ConvertBack (and would be unlikely to do so here) and since its the type of bug that you should catch in testing if it does bite you (since your program would loop i back to the max value of a uint and wind up throwing an exception or (in an absurd case) looping infinitely), it's not something I'm going to rush a change out for. Nonetheless it is a bug and I wanted to let you all know of it and how to fix it.