lua-users home
lua-l archive

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


Hi Jose,

Since a lot of the functionality in our engine does not actually require OOP
and usually we implement game objects fully with Lua, we chose to only use
direct binding to functions (the usual 'C'-way to interface with Lua).

To solve the cases where we do need objects, we use user-data to point to
the instance and have functions manipulate those instances directly. Besides
that, we're using a (small) collection of pointers always available we call
the 'state' (like a render-state). For example, to render a 3D scene first
seek the scene, then seek the camera and then every frame call render().
Since this 'state' can be stored, it is only needed to seek for scene and
camera once; just calling 'render' per frame seems quicker than using
tolua(). Down side of course is no garbage collection (but it is possible to
work around that and still use the Lua gc).

    Best regards,

                Hugo

----- Original Message ----- 
From: "Jose Marin" <jose_marin2@yahoo.com.br>
To: "Lua list" <lua@bazar2.conectiva.com.br>
Sent: Friday, January 20, 2006 4:19 PM
Subject: Re: An entire game written in Lua is possible?


> Hi, Hugo.
>
> Do you use an in-house solution to bind the C++ code
> to Lua, ou some
> available tool (tolua, etc)?
>
>
>
>
>
>
>
>
> _______________________________________________________
> Yahoo! doce lar. Faça do Yahoo! sua homepage.
> http://br.yahoo.com/homepageset.html
>