Skip to content
forked from fccm/OCamlSDL2

OCaml interface to SDL 2.0 (for Linux, Windows, MacOS, and ChromeBook)

License

Notifications You must be signed in to change notification settings

fccm2/OCamlSDL2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OCaml and SDL 2.0

OCaml and SDL

Introduction

OCamlSDL2 is an OCaml interface to the SDL2 library.

If you are searching for OCaml bindings for SDL 1.2 then you should go there instead: ocamlsdl.sf.net

Versions

This version of the bindings is known to work with SDL versions: 2.0.9, 2.0.10, 2.0.14

And OCaml version: 4.07.1, 4.11.1, 4.13.1

Alternatives

Alternative set of bindings are available through the project: Tsdl

Bindings to the same underlying c-lib can be used at the same time (for exemple if you want to switch from one, to another one progressively.)

Compile and Install

Read the file "INSTALL.txt" for instructions about how to compile and install.

Opam

You can install ocamlsdl2 with opam.

If you installed SDL2 version 2.0.9 or later you can install the last version:

$ opam install ocamlsdl2

But if you still use an older version of SDL2 like for example SDL2 version 2.0.6 then you should install a previous version of the bindings:

$ opam install ocamlsdl2.0.02

To know which version of the SDL2 is on your system, you can use the command:

$ sdl2-config --version

To install the source directory (tarball release or git clone):

$ opam install .

Or, if you modified the repository (without commiting):

$ opam install -w .

And to use the current master branch:

$ opam pin -y sdl2 https://github.com/fccm2/OCamlSDL2.git#master

API Documentation

The API documentation can be browsed online:

https://fccm.github.io/OCamlSDL2/

Accompanying libraries

There are also bindings for the accompanying libraries:
(unlike the main ocamlsdl2 these are not tested on Windows yet)

Dune

If you use Dune to build your project, you can use this instruction to your dune file:

  (libraries sdl2)

Esy

Files usable with esy are available in this fork.

License

This software is provided "AS-IS", without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely.

About

OCaml interface to SDL 2.0 (for Linux, Windows, MacOS, and ChromeBook)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • OCaml 57.8%
  • C 39.8%
  • Makefile 2.4%