lua-users home
lua-l archive

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


2009/7/30 Duncan Cross <duncan.cross@gmail.com>:
> On Thu, Jul 30, 2009 at 4:15 PM, Subhash_Patil<Subhash_Patil@satyam.com> wrote:
>>             lua_pushcfunction(L, SCSL_Draw_Rect(L));
>
> Do you mean to be actually calling the function here? It looks like
>
>   lua_pushcfunction(L, SCSL_Draw_Rect);
>
> ...might be what you want instead.

SCSL_Draw_Rect has no declared return type, and no return value, so I
guess it defaults to 0 as an int. Assuming that lua_pushcfunction with
a NULL parameter doesn't throw an error, I'd expect lua_call to throw.

Also the lua_call is passed parameter 5, while only 4 lua_pushinteger
are not commented out, so what is pushed by lua_pushfunction is not
even called. I don't know what is called though.

The pasted code has so many such problems I seriously doubts the
reported symptoms (the printf works but not the draw) are really what
is happening.