Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'function i register
- Public Function Print(ByVal lua_state As IntPtr) As Integer
- Console.WriteLine(clua.GetString(-1))
- End Function
- 'how i register a function
- clua.RegisterCfunction("print", AddressOf Print)
- Public Sub RegisterCfunction(ByVal refname As String, ByVal func As LuaCFunction)
- register(cLuaState, refname, func)
- End Sub
- Friend Sub register(ByVal lua_state As IntPtr, ByVal name As String, ByVal func As LuaCFunction)
- Dim top As Integer = lua_gettop(lua_state) 'upvalues
- lua_pushcclosure(lua_state, func, top)
- lua_setfield(lua_state, LUA_GLOBALSINDEX, name)
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement