Skip to content

drmidnight/SwiftSDL2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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