[REQUEST] Basic Game Loop

Nov 13, 2013 at 3:40 PM
The toolkit is extremely helpful for many of us coming in with an XNA background, but the one piece I feel is missing, is a basic game loop.

Charles Humprey has an excellent DX11 2D and 3D starter kit going on his Randomchaos framework.. I'm working on adding various parts, if not all of the Toolkit into it, but I would love to see a basic game loop in the kit.

Are there any plans to implement such a thing?

Thanks, and keep up the great work!
Nov 13, 2013 at 5:00 PM
The D3D project templates (spinning triangle app) that ship with VS 2013 actually include a pretty decent version of a game loop, with (optional, off by default but all the code is there) fixed timing logic similar to XNA etc. It's greatly improved from the VS 2012 version, so worth taking a look to see if that meets your needs.
Nov 13, 2013 at 6:26 PM
Edited Nov 13, 2013 at 7:08 PM
One of the challenges of the modern DirectX platform landscape is that the 'main loop' is different and more impactfully the entire input and UI paradigm is quite different. As such, DirectXTK is focused on reusable components that are highly portable on all the DirectX 11 platforms. That's why it's a toolkit rather than a framework.

For Windows Store apps on Windows 8.0 and Windows 8.1, as well as Windows phone apps, the Direct3D project templates that ship with VS 2012 and VS 2013 provide a good main loop with all the proper UI integration.

For Win32 desktop applications, this is more wide-open. You can of course use the updated DXUT which is intended as a framework with a main loop for Win32 desktop scenarios, and can be used with DirectXTK.

Instead of trying to address this need with yet another abstract framework, we have a set of Simple Samples for the various platforms:
  • SimpleSample - A Win32 desktop sample using the simple game loop from the Direct3D 11 Win32 tutorials
  • SimpleSample - A Windows Store app sample for Windows 8 using the VS 2012 Direct3D Windows Store app project template
  • SimpelSample - A Windows Store app sample for Windows 8.1 using the VS 2013 Direct3D Windows Store app project template
  • SimpleSample - A Windows phone 8 sample using the VS 2012/2013 Direct3D Windows phone project template
  • SimpleSample - A Win32 desktop sample that demonstrates DirectXTK in combination with the DXUT framework.
Nov 13, 2013 at 6:57 PM
Edited Nov 13, 2013 at 6:59 PM
Great response from both of you. Very informative and clear; I understand the complications far better now. Thank you for linking those samples as well. I didn't realize they had a game loop in them too. I will take a look tonight.