lua-users home
lua-l archive

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


I've been rewriting gllua for lua 4. Its my first lua project so
go easy on me =) 

i have most of it up and running, the test.lua draws a triangle or
two. how do i pull the function name out of an argument so if i have the
following in lua 4 script ?

glutDisplayFunc( display )

i want to get "display" in the c wrapper so i can pass it to
lua_getglobal for lua_call later ?

lua 3 worked a different way and i haven't been able to find an example of
it.

i hardcoded the "display' function for now to get it to work..

next i have a problem with the overloading, i have a function
being called with two numbers

func( 1, 1 )

its possible to have 1 - 4 arguments, so it calls the first function
which takes 4 arguments.

it then uses the tolua_istype to test for each of the 5 arguments ( 4 + 1
for the object) 

but it passes the test, ie if there are two arguments

!tolua_istype(state,3,LUA_TNUMBER,0) ||
!tolua_istype(state,4,LUA_TNUMBER,0)

passes the test and continues to run the wrong code, instead
of dropping down to the 3 argument function.. I'd expect it to
fail since there are only two arguments.


Am I missing something, this seems how it used to work.

regards
charlie.