Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Esdl is a legacy library for accessing SDL and OpenGL from Erlang. (New applications is better off using wx in Erlang/OTP R13B.)
Erlang C JavaScript Shell Perl C++
Pull request Compare This branch is even with bjorng:master.
Failed to load latest commit information.
api_gen removed depreceated calls to erlang:fault in favour of erlang:error
c_src Update with Windows gcc x86 info
ebin Ignore build results and create ebin and priv directories.
include More fixes, configure, more functions moved to thread.
priv Ignore build results and create ebin and priv directories.
src Update with Windows gcc x86 info
test Remove Makefiles and configure scripts and minor fixes
woggle Git converted windows <CR><NL> <NL>
.gitignore Ignore build results and create ebin and priv directories.
README-SDL.txt Initial revision.
Readme Fix building on Mac OS X Initial revision.
license.terms We missed some files and dirs
rebar.config Mac OS X: Ensure that SDL can be found when embedded in Wings
rebar.config.script Fix the previous fix, sigh Update version


ESDL by Dan Gudmundsson 
Currently located at

What is it?
Esdl is library for accessing SDL (Simple DirectMedia Layer)
and OpenGL through Erlang.

Simple DirectMedia Layer is a cross-platform multimedia library
designed to provide fast access to the graphics framebuffer and audio
device. It also do event handling from mouse, keyboards and joysticks.
It is also possible to use TrueType fonts through SDL_ttf
( and images through SDL_image
( More information can be
found at

OpenGL is a cross-platform standard for 3D rendering and
3D hardware acceleration. More information can be found at

   Throw away Makefiles and use rebar for building

   Builds with otp-r15b

   I have removed the opengl specific part from esdl, now esdl
   requires that wx is available for opengl usage.
   This means that this release is not backwards compatible 
   with the old release, some gl functions have been changed in wx gl.

   This is done to only have one gl.erl in your (erlang) system,
   and it also more up to date with the standard.
   Actually only wx/ebin/gl.beam wx/ebin/glu.beam and wx/priv/OS/erl_gl.[so|dll]
   is required.

   Also using wx's opengl allowed me to create an opengl thread,
   if the erlang emulator is multithreaded. So now sdl with opengl
   works for both smp and single threaded erlang.
Compilation and Installation

You need erlang ( This release has only been
tested on R16B, it requires R14B version for opengl to work.

You need libsdl ( (the development package) version > 1.2.5
For windows grab 
    (which work with both gcc and cl and contains both x86 and x64 libs)

On Mac OS X, you also must install XQuartz from:

(Needed for the X11 header files.)

And optionally you'll need:
* SDL_ttf ( version > 2.0.7
* SDL_image ( version > 1.2.4

You need rebar, see:

Build with: 
rebar compile

On windows:
SDL_DIR=/opt/local rebar compile (requires Microsoft's SDK)
CC=gcc SDL_DIR=/opt/local rebar compile (requires mingw)
also copy SDL.dll to esdl/priv dir or put SDL.dll somewhere in your path.

Note: for x64 and mingw-gcc you (currently) can not link against libraries build with 
MCL so you will need to recreate the dependency libs,

::This is currently not supported::

Optionally you'll also need SDL_ttf for the font support 
and SDL_image for the image support.

    Note: SDL_ttf and SDL_image are disabled by default, since they
          depend on libraries not in the plain vanilla SDL packages.
          By making them optional one can compile and run esdl without
          having to bother about getting hold of the SDL_ttf and
          SDL_image libraries.  Enable them in the Makefile:

              ENABLE_SDL_TTF = yes
              ENABLE_SDL_IMAGE = yes

Testing esdl can be done by building the tests in the test directory and 
running the test programs, example:
cd test
erl +S1 -pa ../ebin   (werl on windows) 
Erlang (BEAM) emulator version 5.1.1 [threads:0]
Eshell V5.1.1  (abort with ^G)
1> testsprite:go().    %% Escape quits
2> testgl:go().  
3> erldemo:go().
4> testaudio:go(). 
5> testjoy:go().
6> test_ttf:go("/usr/share/fonts/truetype/freefont/FreeSerif.ttf", 20).
7> test_glfont:go("/usr/share/fonts/truetype/freefont/FreeSans.ttf").
8> test_glimg:go().

/Dan (d g u d @
Something went wrong with that request. Please try again.