lua-users home
lua-l archive

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


I'm running into some trouble with a lua interpreter linked statically with luaglut-0.4.  When I try to run a straightforward translation of the OpenGL Redbook demo select.c, it gives an error in this code

BUFSIZE=512
local selectBuf = memarray('int', BUFSIZE)
glSelectBuffer (BUFSIZE, selectBuf);

$ ./lua select.lua
./lua: select.lua:148: bad argument #2 to `glSelectBuffer' (userdata expected, got userdata)
stack traceback:
        [C]: in function `glSelectBuffer'
        select.lua:148: in function `selectObjects'
        select.lua:183: in function `display'
        [C]: in function `glutMainLoop'
        select.lua:201: in main chunk
        [C]: ?

A Google search for "userdata expected, got userdata" came up empty, so I'm hoping someone here knows what's going on.

Issac