lua-users home
lua-l archive

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


> If you wouldn't mind, I'd like to see a sample.  Your approach may work
> better for me than some of the other proposals here because I'm using Lunar
> to do my binding, and I do not have direct access to the object without
> modifying Lunar, which I'd prefer not to do.
>

I did something similar to emulate OpenGL calls with Cairo graphics.
Cairo requires an object to draw with whereas in OpenGL the state
machine lives outside of the library.  If you look at line 260 of this
file, you'll see the for loop that transforms instance methods to
static methods:

http://www.mat.ucsb.edu/projects/luaAV/browser/branches/luaav3/extra/modules/cgl/init.lua

wes