lua-users home
lua-l archive

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


On Wed, 25 Jul 2007 23:36:02 -0400
L-28C <kixdemp@gmail.com> wrote:

> >> btw, why not incorporate luallegro into your engine (and move
> >> everthing not speed-critical to Lua? %-)
> Sounds like a great idea! :-D
> 
> But, erm, how do I do that? I looked through the LuAllegro source but 
> found nothing resembling a 'register' function to use from C, so I 
> thought of requiring the DLL from within Allegro, but that didn't
> work...
> 
> What's the right way? Thanks! ;-)
the easiest thing is add all luallegro files in your project tree and
call luaopen_allegro() (you can find this function in `lua_aleg.c'). it
will register all luallegro parts. or you can register only necessary
parts. see luaopen_allegro() sources:

luaopen_allegro_root(L);
luaopen_allegro_prim(L);
...
luaopen_allegro_gui (L);
...
etc...

so you can register only what you need. %-)