lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Feb 08, 2002 at 11:05 -0500, J. Perkins wrote:
> Before I ramble on too much, you can get it all here:

Cool!  That's a very very small .exe :)

> it. Writing the SDL wrapper was a little clumsy but I think it would 
> be possible to adapt toLua or swig to write the code, something I 
> might look into.

I originally tried both on the SDL .h files, and ended up using
LuaSWIG.  SWIG takes the same basic approach as toLua: you feed in a
modified form of C/C++ header files, and out comes a .c file with Lua
wrapper functions.  Parsing C/C++ directly to generate a wrapper is
not so easy to do though, so it inevitably involves some manual
tweaking.  I think SWIG is more complete than toLua as far as being
able to parse generic C/C++ code, although I did have to fiddle with
LuaSWIG a little bit to get the results I wanted.

The SDL.i (tweaked versions of SDL headers) and the generated
SDL_wrap.c (Lua binding code) is all in the original meteor shower
package at

A cool feature for LuaSWIG would be to directly generate source for a
lua_uselib and LTN7-compliant module.

> Until I saw Thatcher's game I didn't realize how useful a vanilla
> SDL/OpenGL binding could be for prototyping stuff.

Yeah, it's pretty neat.  I'll probably start writing more graphics
experiments in Lua in the future.

Thatcher Ulrich <>