Lua bindings for the Allegro 5.2 game programming library using SWIG.
Require, use, have fun!
local al = require 'lallegro'
assert (al.init ())
local disp = al.create_display (800, 600)
al.clear_to_color (al.map_rgb (0, 0, 0))
al.flip_display ()
al.rest (5)
al.destroy_display (disp)
1 to 1 function binding is provided to almost all the Allegro API, including
addons. Functions are renamed so the prefix al_
is removed, so the calls to
functions use the Lua module as the Allegro namespace.
A more Lua-style API is being created (the .lua
files) as well, with auto
destroyed objects, metatables/metamethods, iterators, functional stuff, etc...
And it'll all be documented! See the high level Lua wrappers document
for an overview.
Differences between the Allegro C API and this one is detailed in the API diff document.
With cmake:
$ mkdir build
$ cd build
$ cmake ..
$ make
Call cmake with -DALLEGRO_UNSTABLE=1
for including the Allegro Unstable
API
# luarocks install --server=http://luarocks.org/dev lallegro
Using make directly (after building with cmake):
# make install
The Allegro Documentation should be widely used, as lallegro provides 1 to 1 bindings.
LDoc used for documenting the Lua
specific stuff. Generate with ldoc .