annotate XCodeiPhoneOS/Demos/README @ 2421:1bf1cb413ead gsoc2008_iphone

Readme file for iPhone OS Demo applications
author Holmes Futrell <hfutrell@umail.ucsb.edu>
date Fri, 15 Aug 2008 00:37:17 +0000
parents
children f8cd2eecde64
rev   line source
2421
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
1 ==============================================================================
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
2 About the iPhone OS Demo Applications
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
3 ==============================================================================
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
4
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
5 DemosiPhoneOS.xcodeproj contains several targets for iPhone oriented SDL demos. These demos are written strictly using SDL 1.3 calls. All the demos except for Fireworks (which requires OpenGL ES) should work on platforms other than iPhone OS, though you'll need to write your own compile script. To run them on your favorite platform, you may wish to set the macros SCREEN_WIDTH and SCREEN_HEIGHT, located in common.h.
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
6
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
7 Common files:
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
8
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
9 common.c and common.h contain code common to all demo applications. This includes macros about the screen dimensions (in pixels), simple error handling, and functions for generating random numbers.
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
10
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
11 Rectangles (rectangles.c):
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
12
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
13 Draws randomly sized and colored rectangles all over the screen by using SDL_RenderFill. This is the simplest of all the demos.
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
14
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
15 Happy (happy.c):
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
16
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
17 Loads the classic happy-face bitmap and draws a large number of happy faces bouncing around the screen. Shows how you can load a bitmap into an SDL_Texture.
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
18
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
19 Accelerometer (accelerometer.c):
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
20
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
21 Uses the iPhone's accelerometer as a joystick device to move a spaceship around the screen. Note the use of the macro SDL_IPHONE_MAX_GFORCE (normally defined in SDL_config_iphoneos.h) which converts between the Sint16 number returned by SDL_JoystickGetAxis, and the floating point units of g-force reported natively by the iPhone.
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
22
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
23 Touch (touch.c):
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
24
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
25 Acts as a finger-paint type program. Demonstrates how you can use SDL mouse input to accept touch input from the iPhone. If SDL for iPhone is compiled with multitouch as multiple mouse emulation (SDL_IPHONE_MULTIPLE_MICE in SDL_config_iphoneos.h) then the program will accept multiple finger inputs simultaneously.
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
26
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
27 Mixer (mixer.c):
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
28
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
29 Displays several rectangular buttons which can be used as a virtual drumset. Demonstrates how you can play .wav sounds in SDL and how you can use SDL_MixAudioFormat to build a software mixer that can play multiple sounds at once.
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
30
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
31 Keyboard (keyboard.c):
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
32
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
33 Loads a bitmap font and let's the user type words, numbers, and symbols using the iPhone's virtual keyboard. The iPhone's onscreen keyboard visibility is toggled when the user taps the screen. If the user types ':)' a happy face is displayed. Demonstrates how to use functions added to the iPhone implementation of SDL to toggle keyboard onscreen visibility.
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
34
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
35 Fireworks (fireworks.c):
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
36
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
37 Displays a fireworks show. When you tap the iPhone's screen, fireworks fly from the bottom of the screen and explode at the point that you tapped. Demonstrates how you can use SDL on iPhone to build an OpenGL ES based application. Shows you how you can use SDL_LoadBMP to load a bmp image and convert it to an OpenGL ES texture. Of lesser importance, shows how you can use OpenGL ES point sprites to build an efficient particle system.
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
38
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
39 ==============================================================================
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
40 Building and Running the demos
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
41 ==============================================================================
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
42
1bf1cb413ead Readme file for iPhone OS Demo applications
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
43 Before building the demos you must first build SDL as a static library for BOTH the iPhone Simulator and the iPhone itself. See the iPhone SDL main README file for directions on how to do this. Once this is done, simply launch XCode, select the target you'd like to build, select the active SDK (simulator or device), and then build and go.