User Tools

Site Tools


proton:win_setup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
proton:win_setup [2010/10/29 11:39]
seth
proton:win_setup [2012/12/13 06:06] (current)
seth
Line 2: Line 2:
 Use a [[http://​tortoisesvn.net/​downloads|svn client]] to checkout [[svn://​rtsoft.com/​rtsvn/​proton|svn://​rtsoft.com/​rtsvn/​proton]] to a directory. ​ (ie, "​c:​\proton"​ - the checkout path filename should have no spaces) Use a [[http://​tortoisesvn.net/​downloads|svn client]] to checkout [[svn://​rtsoft.com/​rtsvn/​proton|svn://​rtsoft.com/​rtsvn/​proton]] to a directory. ​ (ie, "​c:​\proton"​ - the checkout path filename should have no spaces)
  
-=== RTBareBones ===+<​html>​ 
 +<​strong>​Flash version:</​strong>​ 
 +</​html>​ 
 + 
 +<​html>​ 
 +<div id="​flashContent">​ 
 + <​object classid="​clsid:​D27CDB6E-AE6D-11cf-96B8-444553540000"​ width="​480"​ height="​320"​ id="​RTBareBones"​ align="​middle">​ 
 +   <param name="​movie"​ value="/​games/​test/​RTBareBones.swf"​ /> 
 +              <!--[if !IE]>​-->​ 
 +              <object type="​application/​x-shockwave-flash"​ data="/​games/​test/​RTBareBones.swf"​ width="​480"​ height="​320">​ 
 +              <​!--<​![endif]-->​ 
 +                <param name="​wmode"​ value="​direct"​ /> 
 +                <param name="​allowScriptAccess"​ value="​sameDomain"​ /> 
 +                <param name="​bgcolor"​ value="​CCCCCC"​ />  
 +                <​div>​ 
 +                  <​h1>​You need to update flash:</​h1>​ 
 +                  <​p><​a href="​http://​www.adobe.com/​go/​getflashplayer"><​img src="​http://​www.adobe.com/​images/​shared/​download_buttons/​get_flash_player.gif"​ alt="​Get Adobe Flash player"​ /></​a></​p>​ 
 +                </​div>​ 
 +              <!--[if !IE]>​-->​ 
 +              </​object>​ 
 +              <​!--<​![endif]-->​ 
 +            </​object>​ 
 + </​div>​ 
 +</​html>​ 
 + 
 +=== Running ​RTBareBones ​on Windows===
 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. 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 source files, ​it includes font loading, 2d blitting, and a super simple main game loop.+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.
  
 === Configuration and compiling === === Configuration and compiling ===
-Nagivate ​to  /​RTBareBones/​windows/​RTBareBones.sln and double click to open the solution in MSVC++.+Navigate ​to /​RTBareBones/​windows/​RTBareBones.sln and double click to open the solution in MSVC++.
  
 {{:​proton:​win_setup1.png?​|}} {{:​proton:​win_setup1.png?​|}}
Line 16: Line 43:
 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): 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):
  
-  * Debug (or Debug Common) - Uses the PowerVR libgles library. ​ Useful for debugging GLES specific issues, or testing loading of the .pvr texture format. ​ (It's a compressed format specific to PowerVR, iOS can load them)  Much slower than Debug GL.  (Note: I don't think I can include .lib files from the PowerVR SDK, so this option probably won't work "out of the box"​) +  ​* **Debug** (or Debug Common) - Uses the PowerVR libgles library. ​ Useful for debugging GLES specific issues, or testing loading of the .pvr texture format. ​ (It's a compressed format specific to PowerVR, iOS can load them)  Much slower than Debug GL.  (Note: I don't think I can include .lib files from the PowerVR SDK, so this option probably won't work "out of the box".. but here is [[:​proton_gles_emu|how to set it up]]
-  * Release (or Release Common) - Uses the PowerVR libgles library. ​ You'll probably never use this. +  ​* **Release** (or Release Common) - Uses the PowerVR libgles library. ​ You'll probably never use this. 
-  * Debug GL - Most of your testing is going to be with this.  Standard GL. +  ​* **Debug GL** - Most of your testing is going to be with this.  Standard GL. 
-  * Release GL - For a final Windows build this is what you should use. +  ​* **Release GL** - For a final Windows build this is what you should use. 
-  * Debug WebOS - This config links with the WebOS "SDL like" libraries, useful for debugging WebOS specific issues. I don't have a "​release WebOS",​ not needed as the phone builds are done differently. ​ If you have a gamepad plugged in, you can use it to fake an accelerometer.+  ​* **Debug WebOS** - This config links with the WebOS "SDL like" libraries, useful for debugging WebOS specific issues. I don't have a "​release WebOS",​ not needed as the phone builds are done differently. ​ If you have a gamepad plugged in, you can use it to fake an accelerometer.
  
-Before compiling you should do two things. ​ First, set the working ​directory.+**Note from WoutervD** - If importing the VS2005 project into 2010you may need to set the bin directory ​as following:
  
-{{:proton:win_setup2.png?|}}+{{:proton:win_vs_outputdir.png?100}} <-- not needed for VS2005!
  
-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.+Select the WinRTBareBones project, right click and choose properties. ​Select "All configurations"​ from the drop down and navigate to the general configuration properties page and set the output ​directory to "​..\bin"​.
  
 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. 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.
Line 33: Line 60:
  
 <code cpp> <code cpp>
- AddVideoMode("​Windows",​ 768, 1024, PLATFORM_ID_WINDOWS);​ //used for Dink+ AddVideoMode("​Windows"​, 1024, 768, PLATFORM_ID_WINDOWS);​ 
 + AddVideoMode("​Windows Wide", 800, 1280, PLATFORM_ID_WINDOWS);​ 
 +        ​//OSX 
 + AddVideoMode("​OSX",​ 768, 1024, PLATFORM_ID_OSX);​  
 + AddVideoMode("​OSX Wide", 800, 1280, PLATFORM_ID_OSX);​  
 + 
 + //iOS - for testing on Windows, you should probably use the "​Landscape"​ versions unless you want to hurt your 
 + //neck.
  
  AddVideoMode("​iPhone",​ 320, 480, PLATFORM_ID_IOS);​  AddVideoMode("​iPhone",​ 320, 480, PLATFORM_ID_IOS);​
 + AddVideoMode("​iPhone Landscape",​ 480, 320, PLATFORM_ID_IOS,​ ORIENTATION_PORTRAIT);​ //force orientation for emulation so it's not sideways
  AddVideoMode("​iPad",​ 768, 1024, PLATFORM_ID_IOS);​  AddVideoMode("​iPad",​ 768, 1024, PLATFORM_ID_IOS);​
- AddVideoMode("​iPhone4",​ 640, 960, PLATFORM_ID_IOS);​ + AddVideoMode("​iPad Landscape",​ 1024, 768, PLATFORM_ID_IOS,​ ORIENTATION_PORTRAIT);​ //force orientation for emulation so it's not sideways);​ 
- + AddVideoMode("​iPhone4",​ 640, 960, PLATFORM_ID_IOS, ORIENTATION_PORTRAIT);​ //force orientation for emulation so it's not sideways);); 
- AddVideoMode("​Palm Pre Plus", ​320480PLATFORM_ID_WEBOS); + AddVideoMode("​iPhone4 Landscape", ​960,640PLATFORM_ID_IOS); 
- AddVideoMode("​Pixi", ​320400PLATFORM_ID_WEBOS);+ AddVideoMode("​iPad HD", ​768*21024*2PLATFORM_ID_IOS);
   
 + //Palm er, I mean HP. These should use the Debug WebOS build config in MSVC for the best results, it will
 + //use their funky SDL version
 + AddVideoMode("​Pre",​ 320, 480, PLATFORM_ID_WEBOS);​
 + AddVideoMode("​Pre Landscape",​ 480, 320, PLATFORM_ID_WEBOS);​
 + AddVideoMode("​Pixi",​ 320, 400, PLATFORM_ID_WEBOS);​
 + AddVideoMode("​Pre 3", 480, 800, PLATFORM_ID_WEBOS);​
 + AddVideoMode("​Pre 3 Landscape",​ 800,480, PLATFORM_ID_WEBOS);​
 + AddVideoMode("​Touchpad",​ 768, 1024, PLATFORM_ID_WEBOS);​
 +
 + //Android
  AddVideoMode("​G1",​ 320, 480, PLATFORM_ID_ANDROID);​  AddVideoMode("​G1",​ 320, 480, PLATFORM_ID_ANDROID);​
 + AddVideoMode("​G1 Landscape",​ 480, 320, PLATFORM_ID_ANDROID);​
  AddVideoMode("​Nexus One", 480, 800, 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);​  
- AddVideoMode("​Nexus One Landscape",​ 800, 480, PLATFORM_ID_ANDROID);​ //g_landScapeNoNeckHurtMode should be false when testing+ AddVideoMode("​Droid Landscape"​, 854, 480, PLATFORM_ID_ANDROID);​  
 + AddVideoMode("​Xoom Landscape"​, 1280,800, PLATFORM_ID_ANDROID);​ 
 + AddVideoMode("​Xoom",​ 800,1280, PLATFORM_ID_ANDROID);​ 
 + AddVideoMode("​Galaxy Tab 7.7 Landscape",​ 1024,600, PLATFORM_ID_ANDROID);​ 
 + AddVideoMode("​Galaxy Tab 10.1 Landscape",​ 1280,800, PLATFORM_ID_ANDROID);​ 
 + 
 + //RIM Playbook OS/​BBX/​BB10/​Whatever they name it to next week 
 + AddVideoMode("​Playbook",​ 600,1024, PLATFORM_ID_BBX);​ 
 + AddVideoMode("​Playbook Landscape",​ 1024,600, PLATFORM_ID_BBX);​
  
- string desiredVideoMode = "​iPhone";​ //name needs to match one of the ones defined ​below + string desiredVideoMode = "​iPhone";​ //name needs to match one of the ones defined ​above
-        g_landScapeNoNeckHurtMode = false; //if true, will rotate the screen so we can play in landscape mode in windows without hurting ourselves+
 </​code>​ </​code>​
  
 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. 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.+Make sure you have desiredVideoMode set to "​iPhone"​.
  
 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: 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:
Line 65: Line 118:
 For Windows there are some hotkey equivalents for rotation, try hitting these: For Windows there are some hotkey equivalents for rotation, try hitting these:
  
-  * P - Portrait (same as how it starts up) +  * Ctrl-P - Portrait (same as how it starts up) 
-  * U - Upside down portrait  +  * Ctrl-U - Upside down portrait  
-  * R - Right landscape +  * Ctrl-R - Right landscape 
-  * L - Left landscape+  * Ctrl-L - Left landscape
   * Escape - Quit   * Escape - Quit
 +
 +NOTE: The "fake rotate the screen"​ testing keys above only work on Windows, and only on some setups, such as iPhone and iPad.
  
 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) 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. 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.
 +
 +It also has code to read some keys, the touchscreen,​ and detect shaking. ​ Check the debug log to see the messages.
proton/win_setup.1288352374.txt.gz · Last modified: 2010/10/29 11:39 by seth