Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LUA_FUNCTION( add )
- {
- int a, b;
- a = Lua->GetNumber();
- b = Lua->GetNumber();
- Lua->Push( a + b );
- return 1;
- }
- // Somewhere in the initialization code
- Lua->GetGlobal( "math" );
- Lua->Push( "add" );
- Lua->Push( add );
- Lua->SetField();
Add Comment
Please, Sign In to add comment