Skip to content
项目

关于

Minimal HowTo for building and using SDL3 on a variety of platforms, including mobile and web. Also includes SDL_mixer, SDL_Image, and SDL_ttf!

设计与媒体

这些数字如何统计

实测星标增长

24小时
0
7天
+1
15天
+3
1个月
更新延迟

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

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 for the code.

Building And Running

Are you a complete beginner? If so, read this! Otherwise, install CMake and your favorite compiler, and follow the commands below:

# 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 config/. 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 config/

Note: UWP support was removed from SDL3 during its development. For historical reasons, you can get a working UWP sample via this commit: df270da

Updating SDL

Just update the submodule:

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!

探索相关项目

加载中…