Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.42 KB | None | 0 0
  1. 'function i register
  2. Public Function Print(ByVal lua_state As IntPtr) As Integer
  3.     Console.WriteLine(clua.GetString(-1))
  4. End Function
  5.  
  6. 'how i register a function
  7. Friend Sub register(ByVal lua_state As IntPtr, ByVal name As String, ByVal func As LuaCFunction)
  8.     Dim top As Integer = lua_gettop(lua_state) 'upvalues
  9.     lua_pushcclosure(lua_state, func, top)
  10.     lua_setfield(lua_state, LUA_GLOBALSINDEX, name)
  11. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement