Skip to main content
gamedev.net
🔒 Locked

Luabind: return value problem

Started by unc0r3x Jun 26, 2010 at 10:11 AM 1 replies 850+ views
Original Post
unc0r3x
unc0r3x
Hi there,
I'm using Luabind in combination with IrrLicht. Now I'm trying to bind functions:

in Cpp:
IAnimatedMesh* LoadMesh(const char* path)   {    return smgr->getMesh(path);   } IAnimatedMeshSceneNode* SetMesh(IAnimatedMesh* mesh)   { return smgr->addAnimatedMeshSceneNode( mesh );   } 


Bindings:
    module(L)  [ def("LoadMesh", &LoadMesh)];     module(L)  [ def("SetMesh", &SetMesh)]; 


test script in lua:
tmp_var=LoadMesh("sydney.md2") tmp2=SetMesh(tmp_var)


Irrlicht loads model ("Loaded mesh: sydney.md2"), but didn't show it. I think it's because returned value from LoadMesh was lost. Can anyone explain where I made mistake?

Thanks in advance, and sorry for my bad english.
Sudi
Sudi
well u have to bind IAnimatedMesh and IAnimatedMeshSceneNode as well i guess
unc0r3x
unc0r3x
Quote:
Original post by Sudi
well u have to bind IAnimatedMesh and IAnimatedMeshSceneNode as well i guess


I'm new to luabind, pls, can you give some little sample?

Topic Locked

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

Sign in to reply to this topic.