Skip to content
Thin bindings to SDL for OCaml
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
pkg SDL 2.06.0 support Dec 27, 2017
test Not in my name. Dec 27, 2017
.ocp-indent Not in my name. Dec 27, 2017

Tsdl — Thin bindings to SDL for OCaml


Tsdl is an OCaml library providing thin bindings to the cross-platform SDL C library.

Tsdl depends on the SDL 2.0.6 C library (or later), ocaml-ctypes and the result compatibility package. Tsdl is distributed under the ISC license.

Home page:
Contact: Daniel Bünzli <daniel.buenzl>


Tsdl needs the C library SDL 2.0.6 or later installed on your system. Tsdl can be installed with opam:

opam install tsdl

If you don't use opam consult the opam file for build instructions and a complete specification of the dependencies.


The documentation and API reference is automatically generated by from the source interfaces. It can be consulted online or via odig doc tsdl.

Sample programs

Sample programs are located in the test directory of the distribution. They can be built with:

./pkg/ build --tests true

and listed with

./pkg/ test --list

The resulting binaries are in _build/test :

  • test.native, tests the bindings, the executable should exit with 0.
  • sdlevents.native, traces SDL events.
  • min.native a minimal SDL example.
You can’t perform that action at this time.