I am trying to make use of the DirectXTK's SpriteBatch for the C++ version on github. Which is heavily based on the one for XNA. However I can't seem to get the darned thing to work properly.

I have no idea how to fill in the data for RECT. And the closes thing I have found was in SimpleMath::Rectangle.

SimpleMath::Rectangle appears to have a number of overloads to accommodate RECT, however using it as an argument apparently results in visual studios giving a really vague error. Something about their being no overloads to support it.


RECT is the classic Win32 rectangle structure documented on See MSDN

typedef struct _RECT {
  LONG left;
  LONG top;
  LONG right;
  LONG bottom;

It provides the left,top corner and the right,bottom corner pixel location.

Rectangle should be able to convert to RECT implicitly, but only if you have using DirectX::SimpleMath; to pull it into the namespace.

I cover using RECT for SpriteBatch in the sprites tutorial.

  • \$\begingroup\$ Thank you! Can you also help me fix this problem here? I am sorry if the solution is simple, I've been mentally burned out in the past few days turning some terrible code into frankenstein's monster. stackoverflow.com/questions/40356285/… \$\endgroup\$ – moonshineTheleocat Nov 1 '16 at 8:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.