Re: class method binding problem
Nigel Atkinson <[email protected]>
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <1291791369.3878.3.camel@octavo> |
Ah, another Ogre3d user I see. I've just been playing with Ogre
myself...
Anyhow.
It's a bit hard to tell, perhaps you could copy & paste the error
message? Also is the space at the end of "SceneManager" in your binding
a typo or in your code?
Nigel (merlinblack on the Ogre3d forums)
On Wed, 2010-12-08 at 11:57 +0530, chamika deshan wrote:
> 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
------------------------------------------------------------------------------
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