This is an old revision of the document!
Use a svn client to checkout svn://rtsoft.com/rtsvn/proton to a directory. (ie, “c:\proton” - the checkout path filename should have no spaces)
The first example you should compile is RTBareBones. It's the simplest one, it's the app I use when porting to new operating systems or testing engine features.
RTBarebones is still around 40 “shared” framework source files, and one app level source file. (App.cpp/App.h)
It includes font loading, 2d blitting, and a super simple main game loop.
Nagivate to /RTBareBones/windows/RTBareBones.sln and double click to open the solution in MSVC++.
Choose Debug GL from the configuration drop down.
Here is an explanation of what each configuration is (they all make Windows exe's btw, but different configs can help you emulate platforms better):
Before compiling you should do two things. First, set the working directory.
Select the WinRTBareBones project, right click and choose properties. Set working directory to “..\bin”. I think this is user specific so won't be setup correct by default. Before setting this, you can select “All configurations” so it changes it across each one at the same time.
Next, open main.cpp and double check what the screensize/mode is going to be. Main.cpp is actually shared between ALL the samples (and your own projects usually) so be careful with changes here.
Scroll down until you see something like this:
AddVideoMode("Windows", 768, 1024, PLATFORM_ID_WINDOWS); //used for Dink AddVideoMode("iPhone", 320, 480, PLATFORM_ID_IOS); AddVideoMode("iPad", 768, 1024, PLATFORM_ID_IOS); AddVideoMode("iPhone4", 640, 960, PLATFORM_ID_IOS); AddVideoMode("Palm Pre Plus", 320, 480, PLATFORM_ID_WEBOS); AddVideoMode("Pixi", 320, 400, PLATFORM_ID_WEBOS); AddVideoMode("G1", 320, 480, PLATFORM_ID_ANDROID); AddVideoMode("Nexus One", 480, 800, PLATFORM_ID_ANDROID); AddVideoMode("Droid", 480, 854, PLATFORM_ID_ANDROID); AddVideoMode("Nexus One Landscape", 800, 480, PLATFORM_ID_ANDROID); //g_landScapeNoNeckHurtMode should be false when testing string desiredVideoMode = "iPhone"; //name needs to match one of the ones defined below g_landScapeNoNeckHurtMode = false; //if true, will rotate the screen so we can play in landscape mode in windows without hurting ourselves
This is how you can test “virtually” test many devices with your Windows builds. After things look good, then you can do tests on the device. Using this method saves a ton of time because MSVC debugging is fantastic, and the change/compile/test process happens in seconds rather than minutes.
Make sure you have desiredVideoMode set to “iPhone” and g_landScapeNoNeckHurtMode set to false.
Compile and run. You should see the fps near the top, some rects, a rotating triangle and some colored text scaling up and down near the bottom:
Because we chose iPhone, the screensize is 320×480. If you change to “iPad” and recompile, it will be 640×960. You can add more resolution by adding another “AddVideoMode” call.
If you ran this app on a real iPhone, tilting the device would cause it to rotate to each orientation automatically. (You can disable that later or limit to only landscape modes)
For Windows there are some hotkey equivalents for rotation, try hitting these:
NOTE: The “fake rotate the screen” testing keys above only work on Windows, and only if g_landScapeNoNeckHurtMode is set to false in main.cpp.
RTBareBones is pretty simple, the app specific code is just two files, App.cpp and App.h. (note, the physical source is located in /RTBareBones/source)
The two functions to look at are App::Update() and App::Draw(). Replacing the guts of those two areas is a good place to start experimenting.