class method binding problem
chamika deshan <[email protected]>
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <[email protected]> |
Hi
I am writing a lib with lua bind. I have stucked in problem for the entire
day. Please shed some light.
Following is the class that I need to bind to lua.
class SoundManager
{public:
bool init(const std::string &deviceName = "", unsigned int sources =
100, Ogre::SceneManager* sMan=0);
...
};
And this is what I have done for luabind
luabind::module(luaState)
[
luabind::class_<SoundManager>("SoundManager")
.def(luabind::constructor<>())
.def("init", &SoundManager::init)
...
];
Since I have Ogre::SceneManager as a parameter in init() method, I
guess I have to bind the Ogre::SceneManager class too.
So I did the following.
luabind::module(luaState)
[
luabind::class_<SceneManager>("SceneManager ")
];
And this is my lua code which gives a lua runtime error. It throws
from luabind\detail\call_function.hpp at operator Ret().
Please note that i am getting the error when I call the init() function.
When init function is commented it works fine.
soundManager = SoundManager.getSingletonPtr();
function Manager_getSoundManager()
soundManager:setDistanceModel(AL_LINEAR_DISTANCE);
--soundManager:init();
return soundManager;
end
Please help me with this
~deshan
------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user