https://github.com/haxpor/sdl2-samples
SDL2 sample code
https://github.com/haxpor/sdl2-samples
c samples sdl2
Last synced: 3 months ago
JSON representation
SDL2 sample code
- Host: GitHub
- URL: https://github.com/haxpor/sdl2-samples
- Owner: haxpor
- Created: 2018-10-06T20:47:02.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-18T23:14:13.000Z (over 7 years ago)
- Last Synced: 2025-07-02T09:10:59.824Z (about 1 year ago)
- Topics: c, samples, sdl2
- Language: Java
- Size: 3.88 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SDL2 Sample Code
Sample code along the way of finishing [sdl2-manpage](https://github.com/haxpor/sdl2-manpage)
* Compile and build executable with `gcc -lsdl2 `
* Clean your local working directory with `make clean`
# Android
To test on android
We have two android project for version 2.0.8 and 2.0.9 (development snapshot as of 1 Oct 2018). Choose one that is suitable for your sample code.
* symlink your SDL2 source code directory to `android-project/app/jni` - do this once
* copy testing `.c` source file into `android-project/app/jni/src`
* modify `Android.mk` in `android-project/app/jni/src` to include testing source file, see comment in the file
* execute `./gradlew installDebug` to build and install the app on your Android device
To test on ios
* remove broken of included sub-project as seen in project navigation pane
* add `/Xcode-iOS/SDL/SDL.xcodeproj` as a sub-project
* add more sdl2 sample source code into `src` directory by right click and add files in Xcode
* set "Header Search Path" in Build Settings for your target properly, it should be aligned with headers as referenced by SDL project as you recently added
* create a new target if needed to run each new sample as you added
> There is rectangles sample already added there, so you can see for example.
You can read more about how to manually come up with this iOS sample project from my blog [here](https://blog.wasin.io/2018/10/19/build-sdl2-application-on-ios.html).
# License
MIT, Wasin Thonkaew