SDL_SetHint(SDL_HINT_RENDER_DRIVER, 'metal') 📝 Code Example 🤘 Minimal Metal example application import SDL2 Since it's a system library wrapper you need to install the SDL2 library either via brew install sdl2ĭepending on your platform. Swift SDL2 is available for all platforms that support Swift 5.1 and higher and the Swift Package Manager (SPM).Įxtend the following lines in your Package.swift file or use it to create a new project. These instructions will get your copy of the project up and running on your local machine and provide a code example. SDL is written in C, works natively with C++, and there are bindings available for several other languages, including C# and Python. Support for other platforms may be found in the source code.
SDL officially supports Windows, Mac OS X, Linux, iOS, and Android. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games.
Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. This is a thin Swift wrapper around the popular and excellent Simple DirectMedia Layer library.