MarcoTMP wrote:I)
Irrlicht 0.14
Irrlua 0.6
Audiere 1.9.4
Dusty Engine r9
Newton 1.52
II)
You can include all Audiere .cpp and .h related files to irrlua interpreter and recompile.
Don't know if there is a way to separate packages, but maybe zenaku can give you an answer, he is more expert with lua than me.
Bleh. Well, I tried to get it working, but it's going to take more than 20-30 minutes that I have time to hack tonight
I was actually planning on adding an audiere module to irrlua, so that the irrlicht demo will work 100%.
I have it mostly working already though. I took the audiereLua stuff from irrGameShell and made an audiere.lua.dll module that you could load from lua. Unfortunately, it doesn't actually load.
I'm not sure what's wrong with it.
I was planning on creating a bunch of additional lua modules once I had IrrLua at 1.0. The idea is to have seperate modules that can be individually loaded. There would be no GameShell as all you would need is a standard lua.exe to load the modules. Since lua supports loadlib() there is no need to link anything into the interpreter at all.
You could have something like
Code: Select all
lua.exe
irrlicht.lua.dll <-- new, more proper name for IrrLua
newton.lua.dll
audiere.lua.dll
zip.lua.dll <-- these already exist as LuaZip and LuaSocket
socket.lua.dll
etc...
If you want to try to make it yourself, if you use Visual Studio just create a new Win32/DLL project and add the AudiereLua.cpp file to it.
In the AudiereLua.cpp file I had to remove the line:
and add include the line:
Code: Select all
#include "audiere.lua.h" // replace the with name of
// your DLL project header file
You'll also have to change the TOLUA_API typedefs at the top and bottom of the file to AUDIERELUA_API (or whatever you named your project).
Like I said, mine builds but doesn't load in lua, so I'm not sure what else I'm missing.
edit:
Ok, I got it working. I forgot about stupid extern "C" for DLLs.
To make it work, you need to add
Code: Select all
#ifdef __cplusplus
extern "C" {
#endif
AUDIERELUA_API int tolua_Audiere_open (lua_State* tolua_S);
#ifdef __cplusplus
}
#endif
to your project header file. Since Lua502.dll is made as "C" linkage, anything that links to it also needs "C" linkage. If you don't do that, the compiler makes C++ linkage for a .cpp file.
There are a lot of DLLs that are written in C, and a lot that are written in C++. To make them all play together, most people stick with C linkage for DLLs, even if they are written in C++.