Skip to main content
gamedev.net
🔒 Locked

luabind using singletons

Started by Andybean9 Dec 22, 2005 at 7:17 PM 0 replies 500+ views
Original Post
Andybean9
Andybean9
Hi, I'm sorry if this is already somewhere else, but I looked for a long time and couldn't find the answer to my question. I have been able to set up singletons properly as far as I know with luabind like so:

	luabind::module(ScriptEngine::GetInstance()->GetLuaState()) 
	[
		luabind::class_<CutSceneMgr>("CutSceneManager")
		.def("PushAction", &CutSceneMgr::PushAction)
		.def("PrintAddress", &CutSceneMgr::PrintAddress)
		.def("GetCutSceneMgr", &CutSceneMgr::GetInstance)
	 ];
Now that all compiles fine, my script looks like this:

CSMgr = CutSceneManager.GetCutSceneMgr()
CSMgr:PrintAddress()
When I run the program it prints to the screen Pure Virtual Function Called, but I don't get the printing of the address of the class, which is what PrintAddress does. Any help would be appreciated! Thank you! Andrew

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.