Questions tagged [luabind]

Library to make bindings between C++ and Lua

Luabind is a library that helps you create bindings between C++ and Lua. It has the ability to expose functions and classes, written in C++, to Lua. It will also supply the functionality to define classes in lua and let them derive from other lua classes or C++ classes. Lua classes can override virtual functions from their C++ baseclasses. It is written towards Lua 5.x, and does not work with Lua 4.

177 questions
0
votes
1 answer

LuaBind get function name

How to find out which Lua function called my C++ function, if C++ function exported in scripts by luabind, using callstack in MVS?
Lobster
  • 635
  • 2
  • 12
  • 30
0
votes
1 answer

how to bind a functor with more than one argument to lua using luabind

If I want to bind a functor with one argument to lua using luabind, the following code could help: struct vec { int operator()(int a) { return a + 10; } }; module(L) [ class_("vec") .def( self(int()) ) ]; But…
kingzhang
  • 1
  • 2
0
votes
0 answers

luabind not making changes to pointer mingw

I have fixed the linker errors I had in this question, but now I am having another problem. I create my objects by calling createObject() in lua and that creates a boost::shared_ptr to a new object, adds it to a list, and returns it. On windows with…
chipgw
  • 86
  • 4
0
votes
1 answer

Linking errors with lua & luabind - mingw

I am using luabind for binding my C++ classes to lua, I can get luabind and most lua functions to work, but if I try to use luaL_openlibs() I get: undefined reference to 'luaL_openlibs' collect2: ld returned 1 exit status if I add -llua to the…
chipgw
  • 86
  • 4
0
votes
1 answer

Creation of lua object from c++ base class

I have exported from C++ into lua such base class: class IState { public: virtual ~IState() { } virtual void Init() = 0; virtual void Update(float dSeconds) = 0; virtual void Shutdown() = 0; virtual…
Max Frai
  • 61,946
  • 78
  • 197
  • 306
0
votes
1 answer

use luabind to call C++ member function inherited form base class

C++ code here, a console project class CControl //: public CGameObject { public: CControl(){} ~CControl(){} public: void AddAnimation(){ cout << "CControl::AddAnimation" << endl;} }; int _tmain() { lua_State* L = lua_open(); …
0
votes
1 answer

luabind getting the class metatable of a c++ object to push the obj as argument to lua function

I noticed a severe performance hit, introducing one of my c++ objects as a lua function arg e.g. function luaFunc(someString) print someString end this is pretty fast - less than 30ms for 100k calls now, i added another object function…
Steve
  • 738
  • 1
  • 9
  • 30
0
votes
1 answer

Lua callbacks with meta data

I want to setup a couple of functions in Lua for scripters but when those functions are invoked, I'd like them to actually invoke a single function with a parameter that I define. This might look like: Lua: foo1() foo2() C++: int…
Mickey Kawick
  • 187
  • 1
  • 12
0
votes
1 answer

How can I link to callback functions in Lua such that the callbacks will be updated when the scripts are reloaded?

I'm implementing Lua scripting in my game using LuaBind, and one of the things I'm not clear on is the logistics of reloading the scripts live ingame. Currently, using the LuaBind C++ class luabind::object, I save references to Lua callbacks…
Raptormeat
  • 312
  • 2
  • 14
0
votes
2 answers

2d array from c++ to lua

So,is Passing a multidimensional array from C++ to Lua actually possible? Or should I just make it a normal array,pass it to Lua and convert it there to a 2d array again? And if its possible lets say I've got this function AI(Array) -- can I just…
Makenshi
  • 993
  • 3
  • 15
  • 28
-1
votes
1 answer

Problem with luabind installation under Windows

Cant build luabind. Have downloaded Boost and bjam.exe. Have anybody experience for it under Windows? How i can use this library? Thanks.
Yola
  • 18,496
  • 11
  • 65
  • 106
-1
votes
1 answer

luabind - c++ to lua to c++

I have a problem with luabind, or at least i expect its a problem I have an entity class that ive registered with lua, ideally i want to subclass it and override its functions, from there i want to send it back to c++ and store it additionally i…
Saragan
  • 75
  • 3
  • 10
1 2 3
11
12