README.iOS
changeset 6589 46d985073364
parent 6534 8faa51147576
child 6654 2ecfb25be1e2
child 8314 24f2de48557b
equal deleted inserted replaced
6588:f739b8044c26 6589:46d985073364
   112 ==============================================================================
   112 ==============================================================================
   113 Notes -- iPhone SDL limitations
   113 Notes -- iPhone SDL limitations
   114 ==============================================================================
   114 ==============================================================================
   115 
   115 
   116 Windows:
   116 Windows:
   117 	Full-size, single window applications only.  You cannot create multi-window SDL applications for iPhone OS.  The application window will fill the display, though you have the option of turning on or off the menu-bar (pass SDL_CreateWindow the flag SDL_WINDOW_BORDERLESS).  Presently, landscape mode is not supported.
   117 	Full-size, single window applications only.  You cannot create multi-window SDL applications for iPhone OS.  The application window will fill the display, though you have the option of turning on or off the menu-bar (pass SDL_CreateWindow the flag SDL_WINDOW_BORDERLESS).
   118 
       
   119 Video:
       
   120 	For real time frame-rates, you are advised to use strictly SDL 2.0 video calls.  Using compatibility video calls uploads an OpenGL texture for each frame drawn, and this operation is excruciatingly slow.
       
   121 
   118 
   122 Textures:
   119 Textures:
   123 	SDL for iPhone Textures supports only SDL_PIXELFORMAT_ABGR8888 and SDL_PIXELFORMAT_RGB24 pixel formats.  This is because texture support in SDL for iPhone is done through OpenGL ES, which supports fewer pixel formats than OpenGL, will not re-order pixel data for you, and has no support for color-paletted formats (without extensions).
   120 	The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, and SDL_PIXELFORMAT_RGB24 pixel formats.
   124 
       
   125 Audio:
       
   126 	SDL for iPhone does not yet support audio input.
       
   127 
   121 
   128 Loading Shared Objects:
   122 Loading Shared Objects:
   129 	This is disabled by default since it seems to break the terms of the iPhone SDK agreement.  It can be re-enabled in SDL_config_iphoneos.h.
   123 	This is disabled by default since it seems to break the terms of the iPhone SDK agreement.  It can be re-enabled in SDL_config_iphoneos.h.
   130 
   124 
   131 ==============================================================================
   125 ==============================================================================
   141 e.g.
   135 e.g.
   142 
   136 
   143 extern "C"
   137 extern "C"
   144 void ShowFrame(void*)
   138 void ShowFrame(void*)
   145 {
   139 {
   146     ... do frame logic and rendering
   140     ... do event handling, frame logic and rendering
   147 }
   141 }
   148 
   142 
   149 int main(int argc, char *argv[])
   143 int main(int argc, char *argv[])
   150 {
   144 {
   151    ... initialize game ...
   145    ... initialize game ...
   154         // Initialize the Game Center for scoring and matchmaking
   148         // Initialize the Game Center for scoring and matchmaking
   155         InitGameCenter();
   149         InitGameCenter();
   156 
   150 
   157         // Set up the game to run in the window animation callback on iOS
   151         // Set up the game to run in the window animation callback on iOS
   158         // so that Game Center and so forth works correctly.
   152         // so that Game Center and so forth works correctly.
   159         SDL_iPhoneSetAnimationCallback(screen->GetWindow(), 1, ShowFrame, 0);
   153         SDL_iPhoneSetAnimationCallback(window, 1, ShowFrame, NULL);
   160 #else
   154 #else
   161         while ( gRunning ) {
   155         while ( running ) {
   162                 ShowFrame(0);
   156                 ShowFrame(0);
   163                 DelayFrame();
   157                 DelayFrame();
   164         }
   158         }
   165         CleanUp();
       
   166 #endif
   159 #endif
   167         return 0;
   160         return 0;
   168 }
   161 }