Swiftpack.co - drmidnight/SwiftSDL2 as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by drmidnight.
drmidnight/SwiftSDL2 0.0.20
SDL2 wrapper in Swift
⭐️ 2
🕓 3 years ago
.package(url: "https://github.com/drmidnight/SwiftSDL2.git", from: "0.0.20")

SwiftSDL2

Swift 5.2+ wrapper for SDL2.

DISCLAIMER

Heavily work-in-progress, so use at your own risk. Things will change and evolve as I tackle more of SDL2.

See CSDL2 for bare C wrapper

Current Requirements:

*tested on Ubuntu 20.04 LTS and Mac OS 10.15.5

Linux

Mac

  • brew install sdl2 sdl2_image sdl2_ttf

If you are having issues with headers not found see CSDL2 > shim.h for paths.

Current progress:

SDL2:

Core functionality is there (Window, Renderer, Texture, Surface, Events)

SDL_ttf:

API has nearly full coverage. I left out RW functions that need SDL_RWops wrapped. Also needs proper error handling.

SDL_image

Same as SDL_ttf, needs SDL_RWops wrapped. Which in the case of SDL_image is most of the functions, however you can create a Surface from an image file which covers 90% of the usage.

Example:

See SwiftSDL2Example

License

MIT

GitHub

link
Stars: 2
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Dependencies

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics