OCamlSDL - An interface between OCaml and SDL Overview ======== The goal of OCamlSDL is to provide access the multimedia hardware in the ML programming language with the help of the SDL library. The Simple DirectMedia Layer is a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms. OCamlSDL is hosted on SourceForge.net: http://ocamlsdl.sourceforge.net/ http://www.sourceforge.net/projects/ocamlsdl/ Requirements ============ OCamlSDL needs the following software and libraries: OCaml http://www.ocaml.org/ (3.08.x or 3.07, 3.06 may work) SDL http://www.libsdl.org/ (1.2.x) and optionally: SDL_ttf http://www.libsdl.org/projects/SDL_ttf/ (2.x) SDL_mixer http://www.libsdl.org/projects/SDL_mixer/ (1.2.x) SDL_image http://www.libsdl.org/projects/SDL_image/ (1.2.x) LablGL http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgl.html findlib http://www.ocaml-programming.de/packages/ Using ===== See the INSTALL file (and INSTALL.win32) for information on how to compile and install the library. The library use the Bigarray module (distributed with OCaml), to interface with C so programs using OCamlSDL must also be linked with bigarray. Example : $ ocamlc -c -I /path/to/ocamlsdl my_prog.ml $ ocamlc -o my_prog -I /path/to/ocamlsdl bigarray.cma sdl.cma sdttf.cma my_prog.cmo If OCamlSDL was installed using findlib, the package manager will take care of that: $ ocamlfind ocamlc -c -package sdlttf -linkpkg my_prog.ml $ ocamlfind ocamlc -o my_prog -package sdlttf -linkpkg my_prog.cmo MacOSX users should also read README.macosx . Documentation ============= You can browse the ocaml API documentation at: http://ocamlsdl.sourceforge.net/docs/index.html You can find SDL documentation on the SDL website: http://www.libsdl.org/ http://sdldoc.csn.ul.ie/ Toplevel ======== You can build a custom toplevel including OCamlSDL libraries with: $ ocamlmktop -o ocamlsdl -I /path/to/ocamlsdl -custom bigarray.cma sdl.cma ... If you use OCaml >= 3.04, the static toplevel is not really necessary since you can dynamically load OCamlSDL in the toplevel: $ ocaml Objective Caml version 3.04 # #load "bigarray.cma" ;; # #load "sdl.cma" ;; # Feedback ======== Bugs can be reported on the SourceForge project page or on the mailing lists. There are two mailing lists: ocamlsdl-user@lists.sourceforge.net ocamlsdl-devel@lists.sourceforge.net Subscription information and archives are available here: http://lists.sourceforge.net/lists/listinfo/ocamlsdl-user http://lists.sourceforge.net/lists/listinfo/ocamlsdl-devel -- The OCamlSDL developers