lua-users home
lua-l archive

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


On 5 January 2011 00:43, Wesley Smith <wesley.hoke@gmail.com> wrote:
> On Tue, Jan 4, 2011 at 9:35 PM, beo wulf <beowulf@intamp.com> wrote:
>> Goal: I want to luabind all of OpenGL.
>> Problem: glLightfv( int, int, GLfloat*)
>
> Is there a reason you're not using the existing OpenGL Lua modules?
> There are 2 I know of and both implement your goal:
>
> LuaGL
> http://luagl.sourceforge.net/
>
> opengl module in LuaAV:
> http://lua-av.mat.ucsb.edu/doc/opengl.html
> http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/modules/opengl/src/lua_opengl.cpp

I'll add my own (generated) binding to the list:

https://github.com/henkboom/dokidoki/blob/master/gl.c
https://github.com/henkboom/dokidoki/blob/master/glu.c

They suit my purposes because they are very simple and self-contained.
For glLightfv and other such functions pointers can be given as either
lightuserdata or regular lua strings. This means that it's at least
possible (if not always entirely practical) to manipulate/create the
data from lua. (though I usually use memarray.c for actual array
manipulation).

They mostly support the earlier opengl APIs though, without
extensions. I'll probably regenerate them off of newer header files
sometime soon.

    henk