| 1 |
extern "C" { |
| 2 |
#include "lua.h" |
| 3 |
#include "lualib.h" |
| 4 |
#include "lauxlib.h" |
| 5 |
} |
| 6 |
|
| 7 |
#include "tclass.h" |
| 8 |
|
| 9 |
//Test::Tst_A* Test::Tst_A::last; |
| 10 |
//Test::Tst_B* Test::Tst_B::last; |
| 11 |
//Test::Tst_C* Test::Tst_C::last; |
| 12 |
|
| 13 |
extern "C" { |
| 14 |
int tolua_tclass_open (lua_State*); |
| 15 |
} |
| 16 |
|
| 17 |
int main () |
| 18 |
{ |
| 19 |
Test::Tst_B* b = new Test::Tst_B; // instance used in Lua code |
| 20 |
|
| 21 |
lua_State* L = lua_open(); |
| 22 |
luaL_openlibs(L); |
| 23 |
tolua_tclass_open(L); |
| 24 |
|
| 25 |
luaL_dofile(L,"tclass.lua"); |
| 26 |
|
| 27 |
lua_close(L); |
| 28 |
|
| 29 |
delete b; |
| 30 |
return 0; |
| 31 |
} |
| 32 |
|