sdl2-examples
SDL2 Examples
"hello world" for SDL2 for various programming languages.
Each sample creates a window, displays an image, then waits two seconds and quits.
All executables should ideally build and run on Linux, macOS, Windows, BSD* and more, but they should at least work on Linux. Most subdirectories contains README.md
files with more details, and a Makefile
to have one way of building each sample.
Requirements
- The SDL 2 library.
- See the README.md file per sample for more information.
Requirements for some of the languages
- C compiler that supports C89 (ANSI C), C99 or C11, for the C samples
- A C++ compiler for the C++ sample
- GCC 4.8 or later (or clang++) for the C++11 sample
- Go 1.1 or later and the sdl2 go package (
go get github.com/veandco/go-sdl2/sdl
) - MRuby with SDL2 added to the configuration file
- Nim 0.9.4 and sdl2 installed with babel
- Python 2 or 3 and PySDL2
- FPC 2.6.4 (or later than 2.4.0, must have Uint8, Uint16 and Uint32)
- Lua (tested with Lua 5.3) and lua-sdl2
- If
tcc
is used for compiling one of the C examples, make sure to add-DSDL_DISABLE_IMMINTRIN_H=1
.
Languages that are not added yet
- Ada (see the
ada
directory in theada
branch if you wish to give it a spin, please create a PR if it works on Arch Linux and/or the Linux CI test also passes). - Fortran
- Java (but I gave it a shot).
- Scheme
Pull requests are welcome.
General information
- License: BSD-3
Repository
sdl2-examples
Owner
Statistic
- 306
- 39
- 0
- 0
- 0
- 14 days ago
- May 16, 2014
License
BSD 3-Clause "New" or "Revised" License
Links
Synced at
Wed, 27 Mar 2024 19:48:56 GMT
Languages
Makefile
14.84%
C++
13.65%
Assembly
11.63%
C
7.39%
CMake
5.35%
Dart
5.28%
Scala
5.2%
C#
5.05%
F#
3.98%
Pony
3.47%
Zig
2.81%
Shell
2.23%
Go
2.14%
Kotlin
2.01%
D
1.9%
V
1.5%
Haskell
1.42%
Rust
1.27%
Pascal
1.23%
Odin
1.07%
OCaml
0.9%
Ring
0.84%
Python
0.81%
Nim
0.79%
Ruby
0.77%
Lua
0.69%
Common Lisp
0.63%
FreeBasic
0.63%
Crystal
0.53%