Mercurial > sdl-ios-xcode
comparison README.iphoneos @ 4694:c24ba2cc9583
Merged Jim's Google Summer of Code work from SDL-gsoc2010_gesture
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 22 Aug 2010 12:07:55 -0700 |
parents | f9ab8df6d45a |
children |
comparison
equal
deleted
inserted
replaced
4638:08d22c54a21f | 4694:c24ba2cc9583 |
---|---|
32 3. Include the SDL header files in your project. | 32 3. Include the SDL header files in your project. |
33 4. Remove the ApplicationDelegate.h and ApplicationDelegate.m files -- SDL for iPhone provides its own UIApplicationDelegate. Remove MainWindow.xib -- SDL for iPhone produces its user interface programmatically. | 33 4. Remove the ApplicationDelegate.h and ApplicationDelegate.m files -- SDL for iPhone provides its own UIApplicationDelegate. Remove MainWindow.xib -- SDL for iPhone produces its user interface programmatically. |
34 5. Delete the contents of main.m and program your app as a regular SDL program instead. You may replace main.m with your own main.c, but you must tell XCode not to use the project prefix file, as it includes Objective-C code. | 34 5. Delete the contents of main.m and program your app as a regular SDL program instead. You may replace main.m with your own main.c, but you must tell XCode not to use the project prefix file, as it includes Objective-C code. |
35 | 35 |
36 ============================================================================== | 36 ============================================================================== |
37 Notes -- Touch Input | |
38 ============================================================================== | |
39 | |
40 Touch input in SDL for iPhone OS is presently exposed through SDL's mouse input API. Multi-touch input is reported as multiple mice, with each touch associated with a specific mouse. This association stays coherent from the time the touch starts to the time a touch ends. | |
41 | |
42 By default, multi-touch is turned ON. This requires some care, because if you simply respond to mouse events without checking which mouse caused the event, you may end up fetching data from the wrong mouse, ie, from an incorrect or invalid touch. To turn multi-touch OFF, you can recompile SDL for iPhone with the macro SDL_IPHONE_MULTIPLE_MICE (found in SDL_config_iphoneos.h) set to 0. | |
43 | |
44 ============================================================================== | |
45 Notes -- Accelerometer as Joystick | 37 Notes -- Accelerometer as Joystick |
46 ============================================================================== | 38 ============================================================================== |
47 | 39 |
48 SDL for iPhone supports polling the built in accelerometer as a joystick device. For an example on how to do this, see the accelerometer.c in the demos directory. | 40 SDL for iPhone supports polling the built in accelerometer as a joystick device. For an example on how to do this, see the accelerometer.c in the demos directory. |
49 | 41 |
53 Notes -- OpenGL ES | 45 Notes -- OpenGL ES |
54 ============================================================================== | 46 ============================================================================== |
55 | 47 |
56 Your SDL application for iPhone uses OpenGL ES for video by default. | 48 Your SDL application for iPhone uses OpenGL ES for video by default. |
57 | 49 |
58 OpenGL ES for iPhone supports two display pixel formats, RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively. By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute. | 50 OpenGL ES for iPhone supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively. By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute. |
59 | 51 |
60 If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0. | 52 If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0. |
61 | 53 |
62 Finally, if your application completely redraws the screen each frame, you may find significant performance improvement by setting the attribute SDL_GL_RETAINED_BACKING to 1. | 54 Finally, if your application completely redraws the screen each frame, you may find significant performance improvement by setting the attribute SDL_GL_RETAINED_BACKING to 1. |
63 | 55 |