Now, it is likely once I post this blog, there will suddenly be 10 or 15 Physics Engines modified to work with WinRT, but for now, there aren’t any that have easily discovered documentation.
So what is Windows Run Time? Windows Run Time is a strict protocol that requires that the components have very specific types of interfaces that are different then the previous COM objects. Unlike COM, WinRT components is strictly limited to code that can be compiled into winmd files for consumption by your application that requires language projection.
So, in this article we will investigate:
- What is Windows Run Time and DirectX
- Static Libraries and WinRT
- WinRT C++ and Current Physics/Game Engines
- Tutorial: Create your first Metro style app using C++
- This tutorial is a good addition to your game or business application, it allows you to have a news feed for example
What is Windows Run Time?
When you use C++/CX in Windows Run Time components, you can write components that won’t run on the ARM, but you will be able to work directly with the CPU and GPU, whereas with C# and VB you are required to use .NET Managed Code.
For a video that illustrates the general idea of what WinRT is see:
WinRT with Direct2 and Direct3
As to where is the “x”? If you don’t know if it is Direct2 (2D) or Direct3 (3D) then you use the x as in DirectX
For an excellent presentation on 2D Graphics with Direct2D see (it is somewhat out of date in specifics with the code but up to date generally):
Using WinRT in a Static Libraries
You can create static libraries and then include the WinRT components in them, this way you can generate a number of WinRT components that can be combined into a Static Library, see Static libraries (C++/CX). In this manner, you can now combine WinRT components..
Once you combine the WinRT components together into a Static Library you will need to modify the Metro app you are projecting into.
If you need to find out more about Static Libraries this link will help out:
WinRT C++ and Current Physics/Game engines
There are a number of engines that you might want to take a look at. For instance Box2D, an open source physics engine and it would be possible to modify it to work in WinRT. If you are on a 30 Day approach to building a game and getting into the store, then use Construct2 from http://www.Scirra.com, which will compile into a Visual Studio Project but aren’t quite ready for the Windows Store. The Scirra Construct2 will implement a Windows 8 like shell but doesn’t have the snap, fill screens, however, that is fairly easy to overcome.
Here are the game engines that will likely be there soon, these are likely documented elsewhere, but I researched them for this article and just have to include the documentation. For a video that discusses how to consume a non-WinRT C++ Code set see: Building Windows Runtime Components with C++.
Box2D is a dandy little open source physics engine, and it is used in Physics Helper, Construct2 by Scirra.com and so forth. As it stands in the open source world, it will not work inside of a WinRT form of COM. Why is this? WinRT components created by developers are by designed forced to use the Windows Run Time Libraries, for instance by default WinRT links to a single library, the runtimeobject.lib. If you wanted to include another library directly, such as the Windowscodecs.lib, then you would add it on the line Additional Dependencies. In the near future, but not on 8/31/2012, there are no physics engines that will work in the WinRT system.
The UDK 3 is shown working on Windows Run Time, which in the case of the video is referring to the ability to work on Intel and ARM devices, but I was not able to find the library on the UDK site. The process of “language” projection is not clear and considering the Epic capabilities and presence in the game industry, they are able to manipulate the technology as they see fit. Since the announcement was on 8/29/2012, it might take a few days to get the documentation out there. Feel free to leave a comment if you find it. I will be posting the information if I find it.
For the Unreal Engine 3 article see: http://epicgames.com/news/unreal-engine-3-debuts-on-windows-8, it appears that licensees are able to access the Windows RT code at http://udn.epicgames.com/Main/WebHome.html, but I was unable to locate the documentation.
Autodesk Scaleform 4.1 now supports Windows Metro
The Autodesk Scaleform 4.1 states that it does support Windows 8 Metro in the 4.1 version, but the downloaded files did not show how to do so, and the DirectX version is version 9, if you have time you might want to take a look, but it was just frustrating. Tale a look at ScaleForm at: http://gameware.autodesk.com/scaleform/, you can download the tool for non-commercial use.
In this article you have been given guidance on how to use WinRT and why to use WinRT. At this time, it is possible to use existing game engines with WinRT, but the amount of effort might be larger then you want for the initial launch. There are tools like Construct2 by http://www.scirra.com that can get you up and running quickly. This type of implementation over time is more like a prototyping approach then an actual final production phase, but it can get feedback from the audience on the Microsoft Windows Store.