[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lua-l
Subject:    How to access C Function pointers and Callback
From:       Amit Jain <amitjain.engg () gmail ! com>
Date:       2010-03-29 14:30:57
Message-ID: a1e879d51003290718hc75ce89i260c1449e4b2e769 () mail ! gmail ! com
[Download RAW message or body]

Hello

I am unable to bind the C, Function pointers and callback to access in Lua.

Requirtement: I am trying to bind C [SDL] lib function pointers in Lua with
swig tool.

typedef int (*SDL_EventFilter)(const SDL_Event *event);

void SDL_SetEventFilter(SDL_EventFilter filter);



Now I want that  SDL_SetEventFilter() will take the Lua fuction as a
parameter and Set it as callback of type SDL_EventFilter.



Can anybody help me to do this??


-- 
Thanks & Regards
Amit Jain
+91-9999311609

[Attachment #3 (text/html)]

<p>Hello 
</p><p>
</p><p>I am unable to bind the C, Function pointers and callback to access in Lua. 
</p><p>Requirtement: I am trying to bind C [SDL] lib function pointers in Lua with 
swig tool. 
</p><p>
</p><p><span style="background-color: rgb(255, 255, 255); color: rgb(0, 0, \
255);">typedef int  (*SDL_EventFilter)(const SDL_Event *event);</span><br><span \
style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 255);"> \
</span><br><span style="background-color: rgb(255, 255, 255); color: rgb(0, 0, \
255);">void  SDL_SetEventFilter(SDL_EventFilter filter);</span></p>
<p><span style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 255);"></span> \
</p> <p><span style="background-color: rgb(255, 255, 255); color: rgb(0, 0, \
255);">Now I want that   SDL_SetEventFilter() will take the Lua fuction as a \
parameter and Set it as  callback of type SDL_EventFilter.</span></p>
<p><span style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 255);"></span> \
</p> <p><span style="background-color: rgb(255, 255, 255); color: rgb(255, 0, \
0);">Can anybody help me  to do this??</span></p><br clear="all"><br>-- <br>Thanks \
&amp; Regards<br>Amit Jain <br>+91-9999311609<br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic