How to register function for Barnski's Lua??
#include "DarkGDK.h"
#include "lua_plugin.h"
#pragma comment (lib,"Barnski'sLuaPlugin_debug.lib")
void print(void);
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
int num;
lua::make(); //initialization
lua::register_user_function((DWORD)print,"print","",0,0);
lua::load_file("filename.lua"); //load the config file
num=lua::get_int("alter");
while ( LoopGDK ( ) )
{
dbText(0,0,dbStr(num));
dbSync ( );
}
return;
}
void print(void)
{
dbText(0,0,"Performing lua script call..");
}
LuaFile "filename.lua"
Error:
run time error=lua::register_user_function((DWORD)print,"print","",0,0);
When a person has nothing but a dream, can he dare to dream.