blob: b06644ebad5fcf92c3677a3e7fe6a02b18e3edbb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#include "TestMod.hpp"
#include "tolua.h"
#include "TestModLua.hpp"
#include "LuaVM.hpp"
#include <iostream>
using namespace std;
void Derived::hello( )
{
cout << "hello" << endl;
}
static void initModule( void *user_data )
{
LuaVM *luaVm = (LuaVM *)user_data;
tolua_TestMod_open( luaVm->handle( ) );
}
static void destroyModule( void *user_data )
{
LuaVM *luaVm = (LuaVM *)user_data;
luaVm->fullGarbageCollect( );
}
REGISTER_MODULE( "testmod", &initModule, &destroyModule, Base, Derived )
|