User Tools

Site Tools


proton:win_setup2

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_setup2 [2010/10/27 01:25]
seth
proton:win_setup2 [2012/12/13 06:11] (current)
seth
Line 3: Line 3:
 This application tests audio, the particle system, text input and buttons. This application tests audio, the particle system, text input and buttons.
  
-It illustrates how to use entities and components and is a good sample to "​clone"​ when starting your own project. 
  
-You can compile and run it by following the directions from RTBareBones with one additional thing:+<​html>​ 
 +<​strong>​Flash version:</​strong>​ 
 +</​html>​
  
-==== Installing the FMOD library ​====+<​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/​RTSimpleApp.swf"​ /> 
 +              <!--[if !IE]>​-->​ 
 +              <object type="​application/​x-shockwave-flash"​ data="/​games/​test/​RTSimpleApp.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>​
  
-If you want to hear anything, you'll need FMOD.+It illustrates how to use entities and components and is a good sample to "​clone"​ when starting your own project.
  
-Alternately,​ you could change AudioManagerFMOD g_audioManager;​ in App.cpp to AudioManager g_audioManager,​ this is a dummy audio manager that doesn'​t actually play anything. Useful for when you want to disable sound code alltogether to debug something.+You can compile and run it by following the directions from RTBareBones with one additional thing:
  
-Let's assume you want FMOD - for legal reasons I can't include it with the sdk, but it's very easy to download and copy into the right place.+==== Choosing an audio system ====
  
-First [[http://​www.fmod.org/index.php/​download|download the Windows 32 bit version of FMOD]] and install somewhere. (it's ok if you have a 64 bit version of windows)+The default audio system for Windows is Audiere (thanks to rzuf) It compiles "out of the box" as its lib/dll files are included in Proton.
  
-Locate ​the directory with file explorer ​and cut and paste the entire "​api"​ directory into <main proton dir>/​shared/​win/​fmod+Don't want audio at all?  If you look near the top of App.cpp you'll see where you could comment out AudioManagerAudiere g_audioManager ​and uncomment AudioManager g_audioManager. ​ This is the dummy audio manager that doesn'​t actually play anything.
  
-Ohand also copy fmodex.dll from the api directory into <​main ​proton ​dir>/​RTSimpleApp/​bin or else you'll get a dll not found error. +If for some reason you'd like to switch to the FMOD sound system[[proton:​using_fmod_win|here is info on how to do that.]]
- +
-The app should now compile!+
  
 ==== Building resources ==== ==== Building resources ====
Line 41: Line 59:
 You don't have to. But it's flexible. ​ Would you like to see what the game looks like using 4 bit .pvr textures for your iPhone build? ​ Easy, change a setting in update_media.bat and you can know.  .oggs instead of .mp3s? ​ 16 bit raw textures on Android except for a few important images that should be 32 bit?  A .bat file makes it easy to specify things without ever really modifying your master resource files. You don't have to. But it's flexible. ​ Would you like to see what the game looks like using 4 bit .pvr textures for your iPhone build? ​ Easy, change a setting in update_media.bat and you can know.  .oggs instead of .mp3s? ​ 16 bit raw textures on Android except for a few important images that should be 32 bit?  A .bat file makes it easy to specify things without ever really modifying your master resource files.
  
-Or you may need to non-square textures to be raw data, but square textures to be PVRTC compressed for speed for only a certain platform. (iPhone, cough) ​ RTPack.exe is very powerful and can do this kind of thing with ease.+Or you may need non-square textures to be uncompressed, but square textures to be PVRTC compressed for speed for only a certain platform. (iPhone, cough) ​ RTPack.exe is very powerful and can do this kind of thing with ease.
  
-Remember, when you change a .png, you change it in media/*, and then must run update_media.bat to update the bin versions before you will see it in game.  Android/​iPhone/​WebOS scripts will grab the media from the bin directory. (If you really hate that, yeah, you can just write bmps directly into the bin directory yourself, but you lose the advantages of RTPack.exe being able to convert from nearly any filetype to .rttex and other advantages like padding images to be power of two)+Remember, when you change a .png, you change it in media/*, and then must run update_media.bat to update the bin versions before you will see it in game.  Android/​iPhone/​WebOS scripts will grab the media from the bin directory. (If you really hate that, yeah, you can just write bmps/jpgs directly into the bin directory yourself, but you lose the advantages of RTPack.exe being able to convert from nearly any filetype to .rttex and other advantages like padding images to be power of two)
  
 Processing is fast because the RTPack.exe processor can detect changes and only convert changed/new files. Processing is fast because the RTPack.exe processor can detect changes and only convert changed/new files.
  
 +RTPack.exe is included in shared/​win/​utils btw.  If you run RTPack.exe from the dos prompt, it will spit out the possible options:
 +
 +<​code>​
 +RTPack V1.3 by Seth A. Robinson. ​ /h for help
 +
 +Help and examples
 +
 +RTPack <any file> (Compresses it as an rtpack without changing the name)
 +RTPack -make_font <​filename.txt>​ (Create a .rtfont)
 +
 +More options/​flags for making textures:
 +
 +RTPack -4444 <image file> (Makes raw rgba 16 bit 4444 or 565 if no alpha .rttex)
 +RTPack -8888 <image file> (Creates raw rgba 32 bit .rttex, or 24 bit if no alpha
 +RTPack -8888 -ultra_compress 90 <image file> (Writes .rttex with good compression when there isn't alpha)
 +RTPack -pvrtc4 <image file> (Makes pvrtc .rttex - for PowerVR chipsets)
 +RTPack -pvrtc2 <image file> (Makes low quality pvrtc .rttex - for PowerVR chipsets)
 +More extra flags you can use with texture generation:
 +-mipmaps (Causes mipmaps to be generated)
 +-stretch (Stretches instead of pads to reach power of 2)
 +-force_square (forces textures to be square in addition to being power of 2)
 +-4444_if_not_square_or_too_big (1024 width or height and non square will use -4444)
 +-8888_if_not_square_or_too_big (1024 width or height and non square will use -8888)
 +-flipv (vertical flip, applies to textures only)
 +-force_alpha (force including the alpha channel, even if its not needed
 +-ultra_compress <0 to 100> (100 is best quality. ​ only applied to things that DON'T use alpha)
 +-nopowerof2 (stops rtpack from adjusting images to be power of 2)
 +-o <​format>​ Writes final output as a normal image, useful for testing. ​ Formats can be: png, jpg, or pvr
 +</​code>​
 ==== Landscape vs portrait ==== ==== Landscape vs portrait ====
  
 {{:​proton:​win_setup_4.png?​|}} {{:​proton:​win_setup_4.png?​|}}
 +(Um, actually this pic is out of date, the latest version shows a pic of Seth's kids' face, to illustrate loading a raw .jpg.
  
-Assuming you built your resources right, you'll see this.  Uh oh, it's sideways because in App::Init() it has:+Assuming you built your resources right, and you're using the profile "​iPhone"​, you'll see this.  Uh oh, it's sideways because in App::Init() it has:
 <code cpp> <code cpp>
 SetLockedLandscape(true);​ //we don't allow portrait mode for this game SetLockedLandscape(true);​ //we don't allow portrait mode for this game
Line 58: Line 106:
 This means it will force landscape mode.  It will do a 180 flip if an iPhone is held upside down, but won't flip to portrait modes. This means it will force landscape mode.  It will do a 180 flip if an iPhone is held upside down, but won't flip to portrait modes.
  
-Before you sustain serious neck injury, ​set "g_landScapeNoNeckHurtMode = true" ​in main.cpp'​s InitVideoSize() function.+Before you sustain serious neck injury, ​change your profile to "iPhone Landscape".
  
 It should now look more like this: It should now look more like this:
Line 73: Line 121:
 ==== Music ==== ==== Music ====
 It also has options to turn on and off ogg/mp3 background music. It also has options to turn on and off ogg/mp3 background music.
 +
 +==== Jpg support ====
 +It has the jpg files included and RT_JPG_SUPPORT defined, which allows Proton to load native .jpg files. ​ I haven'​t bothered doing something similar for .png's because .rttex files basically compress the same as .png files.
  
 ==== Automatic scaling to fit the screen ==== ==== Automatic scaling to fit the screen ====
proton/win_setup2.1288142742.txt.gz · Last modified: 2010/10/27 01:25 by seth