https://github.com/jaxkdev/sdl3-sample
https://github.com/jaxkdev/sdl3-sample
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jaxkdev/sdl3-sample
- Owner: JaxkDev
- Created: 2025-05-16T18:36:52.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-16T20:38:51.000Z (about 1 year ago)
- Last Synced: 2025-06-22T05:32:54.626Z (12 months ago)
- Language: CMake
- Size: 4.59 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## SDL3 App From Source Minimal Example
This is a minimal example for building and using SDL3, SDL_Mixer, SDL_Image, and SDL_ttf_ from source
using C++ and CMake. It also demonstrates setting up things like macOS/iOS
bundles.
See [src/main.cpp](src/main.cpp) for the code.
### Building And Running
Install CMake and your favorite compiler, and follow the commands below:
```sh
# You need to clone with submodules, otherwise SDL will not download.
git clone https://github.com/Ravbug/sdl3-sample --depth=1 --recurse-submodules
cd sdl3-sample
cmake -S . -B build
```
You can also use an init script inside [`scripts/`](scripts/). Then open the IDE project inside `build/`
(If you had CMake generate one) and run!
## Supported Platforms
I have tested the following:
| Platform | Architecture | Generator |
| --- | --- | --- |
| macOS | x86_64, arm64 | Xcode |
| iOS | x86_64, arm64 | Xcode |
| tvOS | x86_64, arm64 | Xcode |
| visionOS* | arm64 | Xcode |
| Windows | x86_64, arm64 | Visual Studio |
| Linux | x86_64, arm64 | Ninja, Make |
| Web* | wasm | Ninja, Make |
| Android* | x86, x64, arm, arm64 | Ninja via Android Studio |
*See further instructions in [`scripts/`](scripts/)
Note: UWP support was [removed from SDL3](https://github.com/libsdl-org/SDL/pull/10731) during its development. For historical reasons, you can get a working UWP sample via this commit: [df270da](https://github.com/jaxkdev/sdl3-sample/tree/df270daa8d6d48426e128e50c73357dfdf89afbf)
## Updating SDL
Just update the submodule:
```sh
cd SDL
git pull
cd ..
cd SDL_ttf
git pull
```
You don't need to use a submodule, you can also copy the source in directly. This
repository uses a submodule to keep its size to a minimum.
## Reporting issues
Is something not working? Create an Issue or send a Pull Request on this repository!