lua-users home
lua-l archive

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


All I wanto to do is the following:

In C I have the functions:

int FuncNew();

void FuncSetPos(int ref, float x, float y, float z);

void FuncDelete(int ref);

The first parameter (ref) must be passed to all
funcs(except FuncNew, that will return the reference).

In Lua, I would like to do this:

obj = FuncNew()
OK, just return the reference for the new object.

obj:SetPos(12, 13, 14)

must call FuncSetPos like this:

FuncSetPos(obj.ref, 12, 13, 14)

obj:Delete()

must call FuncDelete like this:

FuncDelete(obj.ref)


Whats the more efficient way of doing this?


______________________________________________________________________

Conheça a nova central de informações anti-spam do Yahoo! Mail:
http://www.yahoo.com.br/antispam