SDL/Xcode-iOS/Demos
Amir e7a47e783b
Some checks failed
Build (Android) / ${{ matrix.platform.name }} (map[android_abi:arm64-v8a android_platform:23 arch:aarch64 cmake:1 name:CMake]) (push) Has been cancelled
Build (Android) / ${{ matrix.platform.name }} (map[name:Android.mk]) (push) Has been cancelled
Build (C/P Actions) / FreeBSD (push) Has been cancelled
Build (Emscripten) / emscripten (push) Has been cancelled
Build (iOS/tvOS) / ${{ matrix.platform.name }} (map[name:iOS sdk:iphoneos target:Static Library-iOS]) (push) Has been cancelled
Build (iOS/tvOS) / ${{ matrix.platform.name }} (map[name:tvOS sdk:appletvos target:Static Library-tvOS]) (push) Has been cancelled
Build / ${{ matrix.platform.name }} (map[artifact:SDL-ubuntu20.04-icc cmake:-DSDL_CLANG_TIDY=OFF intel:true name:Intel Compiler (Ubuntu 20.04) os:ubuntu-20.04 shell:bash source_cmd:source /opt/intel/oneapi/setvars.sh; export CC=icc; export CXX=icpc; export CFL… (push) Has been cancelled
Build / ${{ matrix.platform.name }} (map[artifact:SDL-ubuntu20.04-oneapi intel:true name:Intel oneAPI (Ubuntu 20.04) os:ubuntu-20.04 shell:bash source_cmd:source /opt/intel/oneapi/setvars.sh; export CC=icx; export CXX=icx;]) (push) Has been cancelled
Build / ${{ matrix.platform.name }} (map[autotools:true name:MacOS (autotools) os:macos-latest shell:sh]) (push) Has been cancelled
Build / ${{ matrix.platform.name }} (map[autotools:true name:Ubuntu 20.04 (autotools) os:ubuntu-20.04 shell:sh]) (push) Has been cancelled
Build / ${{ matrix.platform.name }} (map[autotools:true name:Ubuntu 22.04 (autotools) os:ubuntu-22.04 shell:sh]) (push) Has been cancelled
Build / ${{ matrix.platform.name }} (map[cmake:-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" name:MacOS (CMake) os:macos-latest shell:sh]) (push) Has been cancelled
Build / ${{ matrix.platform.name }} (map[msys-env:mingw-w64-clang-i686 msystem:clang32 name:Windows (clang32) os:windows-latest shell:msys2 {0}]) (push) Has been cancelled
Build / ${{ matrix.platform.name }} (map[msys-env:mingw-w64-clang-x86_64 msystem:clang64 name:Windows (clang64) os:windows-latest shell:msys2 {0}]) (push) Has been cancelled
Build / ${{ matrix.platform.name }} (map[msys-env:mingw-w64-i686 msystem:mingw32 name:Windows (mingw32) os:windows-latest shell:msys2 {0}]) (push) Has been cancelled
Build / ${{ matrix.platform.name }} (map[msys-env:mingw-w64-ucrt-x86_64 msystem:ucrt64 name:Windows (ucrt64) os:windows-latest shell:msys2 {0}]) (push) Has been cancelled
Build / ${{ matrix.platform.name }} (map[msys-env:mingw-w64-x86_64 msystem:mingw64 name:Windows (mingw64) os:windows-latest shell:msys2 {0}]) (push) Has been cancelled
Build / ${{ matrix.platform.name }} (map[name:Ubuntu 20.04 (CMake) os:ubuntu-20.04 shell:sh]) (push) Has been cancelled
Build / ${{ matrix.platform.name }} (map[name:Ubuntu 22.04 (CMake) os:ubuntu-22.04 shell:sh]) (push) Has been cancelled
Build (MSVC) / ${{ matrix.platform.name }} (map[flags:-A ARM name:Windows (ARM)]) (push) Has been cancelled
Build (MSVC) / ${{ matrix.platform.name }} (map[flags:-A ARM64 name:Windows (ARM64)]) (push) Has been cancelled
Build (MSVC) / ${{ matrix.platform.name }} (map[flags:-A Win32 -DSDL_FORCE_STATIC_VCRT=ON name:Windows static VCRT (x86)]) (push) Has been cancelled
Build (MSVC) / ${{ matrix.platform.name }} (map[flags:-A Win32 name:Windows (x86) project:VisualC/SDL.sln projectflags:/p:Platform=Win32]) (push) Has been cancelled
Build (MSVC) / ${{ matrix.platform.name }} (map[flags:-A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -DSDL_TESTS=OFF name:UWP (x64) nowerror:true project:VisualC-WinRT/SDL-UWP.sln projectflags:/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.… (push) Has been cancelled
Build (MSVC) / ${{ matrix.platform.name }} (map[flags:-A x64 -DSDL_FORCE_STATIC_VCRT=ON name:Windows static VCRT (x64)]) (push) Has been cancelled
Build (MSVC) / ${{ matrix.platform.name }} (map[flags:-A x64 name:Windows (x64) project:VisualC/SDL.sln projectflags:/p:Platform=x64]) (push) Has been cancelled
Build (MSVC) / ${{ matrix.platform.name }} (map[flags:-T ClangCL -A Win32 name:Windows (clang-cl x86)]) (push) Has been cancelled
Build (MSVC) / ${{ matrix.platform.name }} (map[flags:-T ClangCL -A x64 name:Windows (clang-cl x64)]) (push) Has been cancelled
Build (Nintendo 3DS) / n3ds (push) Has been cancelled
Build (Sony Playstation 2) / ps2 (push) Has been cancelled
Build (Sony Playstation Portable) / psp (push) Has been cancelled
Build (RISC OS) / ${{ matrix.platform.name }} (map[name:CMake]) (push) Has been cancelled
Build (RISC OS) / ${{ matrix.platform.name }} (map[name:autotools test_args:-DTEST_SHARED=FALSE]) (push) Has been cancelled
Build (Sony Playstation Vita) / ${{ matrix.platform.name }} (map[name:GLES (PVR_PSP2 + gl4es4vita) os:windows-latest pvr:true]) (push) Has been cancelled
Build (Sony Playstation Vita) / ${{ matrix.platform.name }} (map[name:GLES (pib) os:windows-latest pib:true]) (push) Has been cancelled
Build (OpenWatcom) / ${{ matrix.platform.name }} (map[makefile:Makefile.os2 name:OS/2]) (push) Has been cancelled
Build (OpenWatcom) / ${{ matrix.platform.name }} (map[makefile:Makefile.w32 name:Windows]) (push) Has been cancelled
Fix warning for Android NDK compiler: "function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]"
https://stackoverflow.com/questions/42125/warning-error-function-declaration-isnt-a-prototype
In C int foo() and int foo(void) are different functions. int foo() accepts an arbitrary number of arguments, while int foo(void) accepts 0 arguments. In C++ they mean the same thing.

(cherry picked from commit ccade50587)
2024-07-17 14:48:06 -07:00
..
data Updated iOS tests and demos for latest SDL linking requirements 2020-11-06 13:03:07 -08:00
Demos.xcodeproj Updated iOS demos Xcode project 2022-09-28 01:10:23 -07:00
src Fix warning for Android NDK compiler: "function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]" 2024-07-17 14:48:06 -07:00
config.xcconfig The iOS and tvOS demos link SDL statically, not as a framework 2022-11-14 10:59:23 -08:00
Default.png Updated iOS tests and demos for latest SDL linking requirements 2020-11-06 13:03:07 -08:00
Icon.png Updated iOS tests and demos for latest SDL linking requirements 2020-11-06 13:03:07 -08:00
iOS Launch Screen.storyboard Updated iOS tests and demos for latest SDL linking requirements 2020-11-06 13:03:07 -08:00
README Updated iOS tests and demos for latest SDL linking requirements 2020-11-06 13:03:07 -08:00

==============================================================================
About the iPhone OS Demo Applications
==============================================================================

Demos.xcodeproj contains several targets for iPhone oriented SDL demos.  These demos are written strictly using SDL 2.0 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.

Common files:

	common.c and common.h contain code common to all demo applications.  This includes functions about delta timing (in seconds), simple error handling, and functions for generating random numbers.

Rectangles (rectangles.c):

	Draws randomly sized and colored rectangles all over the screen by using SDL_RenderFillRect.  This is the simplest of all the demos.

Happy (happy.c):

	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.

Accelerometer (accelerometer.c):

	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. 

Touch (touch.c):

	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. 

Mixer (mixer.c):

	Displays several rectangular buttons which can be used as a virtual drumkit.  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.

Keyboard (keyboard.c):

	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.

Fireworks (fireworks.c):

	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.

==============================================================================
Building and Running the demos
==============================================================================

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.