Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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.)

Readme
ESDL by Dan Gudmundsson 
Currently located at http://esdl.sourceforge.net

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
(www.libsdl.org/projects/SDL_ttf/) and images through SDL_image
(www.libsdl.org/projects/SDL_image/). More information can be
found at libsdl.org

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

News
========= 
1.3.1:
   Throw away Makefiles and use rebar for building

1.3:
   Builds with otp-r15b

1.2:
   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 (www.erlang.org). This release has only been
tested on R16B, it requires R14B version for opengl to work.

You need libsdl (www.libsdl.org) (the development package) version > 1.2.5
For windows grab SDL-devel-1.2.15-VC.zip 
    (which work with both gcc and cl and contains both x86 and x64 libs)

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

   http://xquartz.macosforge.org

(Needed for the X11 header files.)

And optionally you'll need:
* SDL_ttf (www.libsdl.org/projects/SDL_ttf/) version > 2.0.7
* SDL_image (www.libsdl.org/projects/SDL_image/) version > 1.2.4

You need rebar, see: github.com/rebar/rebar

Build with: 
rebar compile

On windows:
===========
SDL_DIR=/opt/local rebar compile (requires Microsoft's SDK)
or 
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,
see http://sourceforge.net/apps/trac/mingw-w64/wiki/Answer%2064%20bit%20MSVC-generated%20x64%20.lib

::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().


Regards 
/Dan (d g u d @ users.sf.net)
Something went wrong with that request. Please try again.