Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Racket bindings to the Allegro5 library

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 README
Octocat-spinner-32 allegro.rkt
Octocat-spinner-32 main.rkt
Octocat-spinner-32 test.rkt
README
Racket bindings to Allegro 5

Racket: http://racket-lang.org
Allegro5: http://allegro5.org

== Quick Setup ==

$ mkdir lib
$ cd lib
$ ln -s /path/to/allegro/build/lib/*.so .
$ cd ..
$ raco link .

To use, build Allegro5 and put the .so files in lib/

== Basic Program ==

Always run the game by passing a function to the `run' method of the allegro5 library.
This ensures that various contexts are properly initialized.

(require (prefix-in allegro: "allegro.rkt"))
(define (my-game)
  (define display (allegro:create-display 640 480))
  .. rest of code here ..
  )

(allegro:run my-game)

Look at test.rkt to get a better idea of how allegro5 can be used.

Quick build instructions for Allegro5 on any unix system
 
 $ cd allegro5
 $ mkdir b
 $ cd b
 $ cmake -DWANT_MONOLITH=yes ..
 $ make
 ..
 $ cd racket-allegro-5/lib
 $ ln -s /path/to/allegro/b/lib/* .

Here is my lib directory so you can see how to set it up

 $ ls -l lib/
 lrwxrwxrwx 1 jon jon 52 2011-03-08 16:05 liballegro_acodec.so -> /home/jon/svn/allegro/5.0/b/lib/liballegro_acodec.so*
 lrwxrwxrwx 1 jon jon 51 2011-03-08 16:05 liballegro_audio.so -> /home/jon/svn/allegro/5.0/b/lib/liballegro_audio.so*
 lrwxrwxrwx 1 jon jon 51 2011-03-08 16:05 liballegro_color.so -> /home/jon/svn/allegro/5.0/b/lib/liballegro_color.so*
 lrwxrwxrwx 1 jon jon 52 2011-03-08 16:05 liballegro_dialog.so -> /home/jon/svn/allegro/5.0/b/lib/liballegro_dialog.so*
 lrwxrwxrwx 1 jon jon 50 2011-03-08 16:05 liballegro_font.so -> /home/jon/svn/allegro/5.0/b/lib/liballegro_font.so*
 lrwxrwxrwx 1 jon jon 51 2011-03-08 16:05 liballegro_image.so -> /home/jon/svn/allegro/5.0/b/lib/liballegro_image.so*
 lrwxrwxrwx 1 jon jon 50 2011-03-08 16:05 liballegro_main.so -> /home/jon/svn/allegro/5.0/b/lib/liballegro_main.so*
 lrwxrwxrwx 1 jon jon 53 2011-03-08 16:05 liballegro_memfile.so -> /home/jon/svn/allegro/5.0/b/lib/liballegro_memfile.so*
 lrwxrwxrwx 1 jon jon 56 2011-03-08 16:05 liballegro_primitives.so -> /home/jon/svn/allegro/5.0/b/lib/liballegro_primitives.so*
 lrwxrwxrwx 1 jon jon 45 2011-03-08 16:05 liballegro.so -> /home/jon/svn/allegro/5.0/b/lib/liballegro.so*
 lrwxrwxrwx 1 jon jon 49 2011-03-08 16:05 liballegro_ttf.so -> /home/jon/svn/allegro/5.0/b/lib/liballegro_ttf.so*
 lrwxrwxrwx 1 jon jon 41 2011-03-08 16:05 pkgconfig -> /home/jon/svn/allegro/5.0/b/lib/pkgconfig/
Something went wrong with that request. Please try again.