lua-users home
lua-l archive

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

Hi List,
I'm currently designing a system for audiovisual work that has a
number of distinct lua modules as its core.  Each module is written as
a set of C++ classes, which are bound as userdata.  Some examples are
an OpenGL based rendering module, a physics module, and a
computational geometry module.

I'm currently confronted with the problem of how to share classes
between the modules.  For example, the computational geometry module
has a number of functions that fill buffers with vertices which I then
want to feed to the OpenGL module to render.  I have a basic utlity
class Buffer tat I want to use in both cases but I'm not quite sure
how a) setup the module project build system to accomodate this and b)
setup the bindings to Lua so that both modules can know about Buffer
with a minimum of coupling.  The way my userdata bindings work, each
class has a static char *name varaible whose pointer I use to
determine if a userdata really belongs to a class.  I'm a bit stumped
with this one, so any thoughts appreciated.