lua-users home
lua-l archive

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


Hello All,

This is my first ever email to a mail list (weird i know).
I have been reading this list for a while and have a blog on my
game engine that uses lua bound to c++.
 
here is a link, the video a bunch of posts down talks about how i use Lua with C++.

I have a pretty strong opinion about the matter. I use luna to wrap my Engine kind of.

I basically have a main EngineManager class which exposes some API like functions to lua for
creating, moving, and deleting graphical assets. Lua is to handle all of the game logic.

I push my class on in the init stage of the engine, using userdata and the registry, basically using what luna does
only pushing the actual object. and the all access to anything else is from lua is done through the EngineManager's provided Lua API.

I'm not a HUGE fan of binding C++ classes to lua, since i feel like architecturally it defeats the purpose of
the advantages of the language. Tables provide enough OOP like functionality and I use an ID/HashTable
system to refer to any objects in C++. Pointers could be used, but there are pros and cons for doing it either way.

Anyways. the video in my blog goes into a bit more detail.

-Joe

PS. How do I reply to the message properly...?