Lua Module Lua Sdl |
|
A Lua binary module, for accessing SDL from Lua scripts. SDL stands for "Simple DirectMedia? Layer", and is a comprehensive, open-source, cross-platform multimedia API that can be used to produce professional-quality games. [1]
VersionNotice: This page largely pertains to an earlier version of Lua (4.0 and 5.0beta) using a loadmodule
extension. Lua 5.1 uses package.loadlib
and require
. Lua 5.0 uses loadlib
.)
luaSDL was built using the SDL header files and the tool tolua
[2]. luaSDL is designed to
be used with a Lua40 interpreter, with loadmodule support. See
LuaBinaryModules .
This source code is also maintained in CVS as a subset of the tu-testbed project on sourceforge [3]
There is a sample game, "Meteor Shower", in the source archive (in the samples/
subdirectory). It's written entirely in Lua, using luaSDL to handle graphics and input. It's sort of a pacifist Asteroids with gravity.
users of other platforms: please contribute ports!
I had problems building luaSDL with linux, gcc3.3, lua5.0 and tolua5.0alpha. Variables of the same name, but different classes got the same C function names for their getters and setters. I fixed the problem in tolua and (for testing) ported the sample game from lua4 to lua5 - the patches are here: [4] -- AndreKloss?
A Lua 5.0 version of the test game is included in the latest LuaCheia distribution.