{"payload":{"allShortcutsEnabled":false,"fileTree":{"":{"items":[{"name":"VisualC-WinRT","path":"VisualC-WinRT","contentType":"directory"},{"name":"VisualC","path":"VisualC","contentType":"directory"},{"name":"Xcode-iOS","path":"Xcode-iOS","contentType":"directory"},{"name":"Xcode","path":"Xcode","contentType":"directory"},{"name":"acinclude","path":"acinclude","contentType":"directory"},{"name":"android-project","path":"android-project","contentType":"directory"},{"name":"build-scripts","path":"build-scripts","contentType":"directory"},{"name":"cmake","path":"cmake","contentType":"directory"},{"name":"debian","path":"debian","contentType":"directory"},{"name":"include","path":"include","contentType":"directory"},{"name":"premake","path":"premake","contentType":"directory"},{"name":"src","path":"src","contentType":"directory"},{"name":"test","path":"test","contentType":"directory"},{"name":"visualtest","path":"visualtest","contentType":"directory"},{"name":".hgignore","path":".hgignore","contentType":"file"},{"name":"Android.mk","path":"Android.mk","contentType":"file"},{"name":"BUGS.txt","path":"BUGS.txt","contentType":"file"},{"name":"CMakeLists.txt","path":"CMakeLists.txt","contentType":"file"},{"name":"COPYING.txt","path":"COPYING.txt","contentType":"file"},{"name":"CREDITS.txt","path":"CREDITS.txt","contentType":"file"},{"name":"INSTALL.txt","path":"INSTALL.txt","contentType":"file"},{"name":"Makefile.in","path":"Makefile.in","contentType":"file"},{"name":"Makefile.minimal","path":"Makefile.minimal","contentType":"file"},{"name":"Makefile.pandora","path":"Makefile.pandora","contentType":"file"},{"name":"Makefile.psp","path":"Makefile.psp","contentType":"file"},{"name":"Makefile.wiz","path":"Makefile.wiz","contentType":"file"},{"name":"README-SDL.txt","path":"README-SDL.txt","contentType":"file"},{"name":"README-android.txt","path":"README-android.txt","contentType":"file"},{"name":"README-cmake.txt","path":"README-cmake.txt","contentType":"file"},{"name":"README-directfb.txt","path":"README-directfb.txt","contentType":"file"},{"name":"README-dynapi.txt","path":"README-dynapi.txt","contentType":"file"},{"name":"README-gesture.txt","path":"README-gesture.txt","contentType":"file"},{"name":"README-hg.txt","path":"README-hg.txt","contentType":"file"},{"name":"README-ios.txt","path":"README-ios.txt","contentType":"file"},{"name":"README-linux.txt","path":"README-linux.txt","contentType":"file"},{"name":"README-macosx.txt","path":"README-macosx.txt","contentType":"file"},{"name":"README-nacl.txt","path":"README-nacl.txt","contentType":"file"},{"name":"README-pandora.txt","path":"README-pandora.txt","contentType":"file"},{"name":"README-platforms.txt","path":"README-platforms.txt","contentType":"file"},{"name":"README-porting.txt","path":"README-porting.txt","contentType":"file"},{"name":"README-psp.txt","path":"README-psp.txt","contentType":"file"},{"name":"README-raspberrypi.txt","path":"README-raspberrypi.txt","contentType":"file"},{"name":"README-touch.txt","path":"README-touch.txt","contentType":"file"},{"name":"README-wince.txt","path":"README-wince.txt","contentType":"file"},{"name":"README-windows.txt","path":"README-windows.txt","contentType":"file"},{"name":"README-winrt.txt","path":"README-winrt.txt","contentType":"file"},{"name":"README.txt","path":"README.txt","contentType":"file"},{"name":"SDL2.spec.in","path":"SDL2.spec.in","contentType":"file"},{"name":"TODO.txt","path":"TODO.txt","contentType":"file"},{"name":"VisualC.html","path":"VisualC.html","contentType":"file"},{"name":"WhatsNew.txt","path":"WhatsNew.txt","contentType":"file"},{"name":"autogen.sh","path":"autogen.sh","contentType":"file"},{"name":"cmake_uninstall.cmake.in","path":"cmake_uninstall.cmake.in","contentType":"file"},{"name":"configure","path":"configure","contentType":"file"},{"name":"configure.in","path":"configure.in","contentType":"file"},{"name":"sdl2-config.in","path":"sdl2-config.in","contentType":"file"},{"name":"sdl2.m4","path":"sdl2.m4","contentType":"file"},{"name":"sdl2.pc.in","path":"sdl2.pc.in","contentType":"file"}],"totalCount":58}},"fileTreeProcessingTime":2.2727139999999997,"foldersToFetch":[],"repo":{"id":330008801,"defaultBranch":"main","name":"SDL","ownerLogin":"libsdl-org","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2021-01-15T19:55:54.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/77683370?v=4","public":true,"private":false,"isOrgOwned":true},"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"a838a56d45b237888810ca4c76d9345fe98f27f6","listCacheKey":"v0:1709678518.0","canEdit":false,"refType":"tree","currentOid":"a838a56d45b237888810ca4c76d9345fe98f27f6"},"path":"README-ios.txt","currentUser":null,"blob":{"rawLines":["==============================================================================\r","Building the Simple DirectMedia Layer for iPhone OS 5.1\r","==============================================================================\r","\r","Requirements: Mac OS X v10.5 or later and the iPhone SDK.\r","\r","Instructions:\r","1. Open SDL.xcodeproj (located in Xcode-iOS/SDL) in XCode.\r","2. Select your desired target, and hit build.\r","\r","There are three build targets:\r","- libSDL.a:\r","\tBuild SDL as a statically linked library\r","- testsdl\r","\tBuild a test program (there are known test failures which are fine)\r","- Template:\r","\tPackage a project template together with the SDL for iPhone static libraries and copies of the SDL headers. The template includes proper references to the SDL library and headers, skeleton code for a basic SDL program, and placeholder graphics for the application icon and startup screen.\r","\r","==============================================================================\r","Build SDL for iOS from the command line\r","==============================================================================\r","\r","1. cd (PATH WHERE THE SDL CODE IS)/build-scripts\r","2. ./iosbuild.sh\r","\r","If everything goes fine, you should see a build/ios directory, inside there's\r","two directories \"lib\" and \"include\". \r","\"include\" contains a copy of the SDL headers that you'll need for your project,\r","make sure to configure XCode to look for headers there.\r","\"lib\" contains find two files, libSDL2.a and libSDL2main.a, you have to add both \r","to your XCode project. These libraries contain three architectures in them,\r","armv6 for legacy devices, armv7, and i386 (for the simulator).\r","By default, iosbuild.sh will autodetect the SDK version you have installed using \r","xcodebuild -showsdks, and build for iOS >= 3.0, you can override this behaviour \r","by setting the MIN_OS_VERSION variable, ie:\r","\r","MIN_OS_VERSION=4.2 ./iosbuild.sh\r","\r","==============================================================================\r","Using the Simple DirectMedia Layer for iOS\r","==============================================================================\r","\r","FIXME: This needs to be updated for the latest methods\r","\r","Here is the easiest method:\r","1. Build the SDL libraries (libSDL.a and libSDLSimulator.a) and the iPhone SDL Application template.\r","1. Install the iPhone SDL Application template by copying it to one of XCode's template directories. I recommend creating a directory called \"SDL\" in \"/Developer/Platforms/iOS.platform/Developer/Library/XCode/Project Templates/\" and placing it there.\r","2. Start a new project using the template. The project should be immediately ready for use with SDL.\r","\r","Here is a more manual method:\r","1. Create a new iPhone view based application.\r","2. Build the SDL static libraries (libSDL.a and libSDLSimulator.a) for iPhone and include them in your project. XCode will ignore the library that is not currently of the correct architecture, hence your app will work both on iPhone and in the iPhone Simulator.\r","3. Include the SDL header files in your project.\r","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.\r","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.\r","\r","==============================================================================\r","Notes -- Application events\r","==============================================================================\r","\r","On iOS the application goes through a fixed life cycle and you will get\r","notifications of state changes via application events. When these events\r","are delivered you must handle them in an event callback because the OS may\r","not give you any processing time after the events are delivered.\r","\r","e.g.\r","\r","int HandleAppEvents(void *userdata, SDL_Event *event)\r","{\r"," switch (event->type)\r"," {\r"," case SDL_APP_TERMINATING:\r"," /* Terminate the app.\r"," Shut everything down before returning from this function.\r"," */\r"," return 0;\r"," case SDL_APP_LOWMEMORY:\r"," /* You will get this when your app is paused and iOS wants more memory.\r"," Release as much memory as possible.\r"," */\r"," return 0;\r"," case SDL_APP_WILLENTERBACKGROUND:\r"," /* Prepare your app to go into the background. Stop loops, etc.\r"," This gets called when the user hits the home button, or gets a call.\r"," */\r"," return 0;\r"," case SDL_APP_DIDENTERBACKGROUND:\r"," /* This will get called if the user accepted whatever sent your app to the background.\r"," If the user got a phone call and canceled it, you'll instead get an SDL_APP_DIDENTERFOREGROUND event and restart your loops.\r"," When you get this, you have 5 seconds to save all your state or the app will be terminated.\r"," Your app is NOT active at this point.\r"," */\r"," return 0;\r"," case SDL_APP_WILLENTERFOREGROUND:\r"," /* This call happens when your app is coming back to the foreground.\r"," Restore all your state here.\r"," */\r"," return 0;\r"," case SDL_APP_DIDENTERFOREGROUND:\r"," /* Restart your loops here.\r"," Your app is interactive and getting CPU again.\r"," */\r"," return 0;\r"," default:\r"," /* No special processing, add it to the event queue */\r"," return 1;\r"," }\r","}\r","\r","int main(int argc, char *argv[])\r","{\r"," SDL_SetEventFilter(HandleAppEvents, NULL);\r","\r"," ... run your main loop\r","\r"," return 0;\r","}\r","\r"," \r","==============================================================================\r","Notes -- Accelerometer as Joystick\r","==============================================================================\r","\r","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.\r","\r","The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_JoystickGetAxis reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_JoystickGetAxis reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF.\r","\r","==============================================================================\r","Notes -- OpenGL ES\r","==============================================================================\r","\r","Your SDL application for iPhone uses OpenGL ES for video by default.\r","\r","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.\r","\r","If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0.\r","\r","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.\r","\r","==============================================================================\r","Notes -- Keyboard\r","==============================================================================\r","\r","The SDL keyboard API has been extended to support on-screen keyboards:\r","\r","void SDL_StartTextInput()\r","\t-- enables text events and reveals the onscreen keyboard.\r","void SDL_StopTextInput()\r","\t-- disables text events and hides the onscreen keyboard.\r","SDL_bool SDL_IsTextInputActive()\r","\t-- returns whether or not text events are enabled (and the onscreen keyboard is visible)\r","\r","==============================================================================\r","Notes -- Reading and Writing files\r","==============================================================================\r","\r","Each application installed on iPhone resides in a sandbox which includes its own Application Home directory. Your application may not access files outside this directory.\r","\r","Once your application is installed its directory tree looks like:\r","\r","MySDLApp Home/\r","\tMySDLApp.app\r","\tDocuments/\r","\tLibrary/\r","\t\tPreferences/\r","\ttmp/\r","\r","When your SDL based iPhone application starts up, it sets the working directory to the main bundle (MySDLApp Home/MySDLApp.app), where your application resources are stored. You cannot write to this directory. Instead, I advise you to write document files to \"../Documents/\" and preferences to \"../Library/Preferences\". \r","\r","More information on this subject is available here:\r","http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html\r","\r","==============================================================================\r","Notes -- iPhone SDL limitations\r","==============================================================================\r","\r","Windows:\r","\tFull-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).\r","\r","Textures:\r","\tThe optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, and SDL_PIXELFORMAT_RGB24 pixel formats.\r","\r","Loading Shared Objects:\r","\tThis 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.\r","\r","==============================================================================\r","Game Center \r","==============================================================================\r","\r","Game Center integration requires that you break up your main loop in order to yield control back to the system. In other words, instead of running an endless main loop, you run each frame in a callback function, using:\r"," \r","int SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);\r","\r","This will set up the given function to be called back on the animation callback, and then you have to return from main() to let the Cocoa event loop run.\r","\r","e.g.\r","\r","extern \"C\"\r","void ShowFrame(void*)\r","{\r"," ... do event handling, frame logic and rendering\r","}\r","\r","int main(int argc, char *argv[])\r","{\r"," ... initialize game ...\r","\r","#if __IPHONEOS__\r"," // Initialize the Game Center for scoring and matchmaking\r"," InitGameCenter();\r","\r"," // Set up the game to run in the window animation callback on iOS\r"," // so that Game Center and so forth works correctly.\r"," SDL_iPhoneSetAnimationCallback(window, 1, ShowFrame, NULL);\r","#else\r"," while ( running ) {\r"," ShowFrame(0);\r"," DelayFrame();\r"," }\r","#endif\r"," return 0;\r","}\r"],"stylingDirectives":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/libsdl-org/SDL/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"README-ios.txt","displayUrl":"https://github.com/libsdl-org/SDL/blob/a838a56d45b237888810ca4c76d9345fe98f27f6/README-ios.txt?raw=true","headerInfo":{"blobSize":"10.9 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":null,"isGitLfs":false,"onBranch":false,"shortPath":"4e6ca0e","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Flibsdl-org%2FSDL%2Fblob%2Fa838a56d45b237888810ca4c76d9345fe98f27f6%2FREADME-ios.txt","isCSV":false,"isRichtext":false,"toc":null,"lineInfo":{"truncatedLoc":"222","truncatedSloc":"173"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"Text","languageID":372,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/libsdl-org/SDL/blob/a838a56d45b237888810ca4c76d9345fe98f27f6/README-ios.txt","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/libsdl-org/SDL/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/libsdl-org/SDL/raw/a838a56d45b237888810ca4c76d9345fe98f27f6/README-ios.txt","renderImageOrRaw":false,"richText":null,"renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":{"timed_out":false,"not_analyzed":true,"symbols":[]}},"copilotInfo":null,"copilotAccessAllowed":false,"csrf_tokens":{"/libsdl-org/SDL/branches":{"post":"GPLeyVTd8aWCbBeQ6AThkW0JXmYfNzDtA22-Z7WaFTYNhkkv0IZw9yHX3HIXRCA6TFNo5VkXBuuOlYel6VJXLg"},"/repos/preferences":{"post":"8nJ3y0_fRvqX9mEBTINAg7nrNNaZIZZDa0PVVFEHtBd0SnpLCPqAiYc8DP8s3DafpMTNrnlhvR66ye1SPLLpyw"}}},"title":"SDL/README-ios.txt at a838a56d45b237888810ca4c76d9345fe98f27f6 ยท libsdl-org/SDL"}