Hey,
This is specifically for Rez as you wrote the Lua Chapter. I am using Luabind which is slightly different than the examples shown, however that doesn't really have much to do with the question.
In different Manager Classes I have been exposing certain methods to Lua, for instance in CApplication (My Application Layer)
Display All
This works great, I guess luabind automatically matches my CApplication instance to the CApplication Definition exposed to Lua. Several of my systems are Singleton Classes so I have been passing in the 'this' pointer right from the constructor.
In the Lua Scripting Chapter there was a small section called Internal Script Exports, I was not completely sure what this was, but just to clarify, this is a central spot to put all the Lua Exposures rather then putting them right in the classes constructor?
This is specifically for Rez as you wrote the Lua Chapter. I am using Luabind which is slightly different than the examples shown, however that doesn't really have much to do with the question.
In different Manager Classes I have been exposing certain methods to Lua, for instance in CApplication (My Application Layer)
Source Code
- lua_State* pLuaSate = m_pLuaManager->GetLuaState();
- luabind::module(pLuaSate)
- [
- class_<CApplication>("CApplication")
- .def("Quit", &CApplication::Quit)
- .def("GetLogic", &CApplication::GetGameLogic)
- .def("GetResCache", &CApplication::GetResourceCache)
- .def("GetTimer", &CApplication::GetTimer)
- .def("GetWidth", &CApplication::GetWidth)
- .def("GetHeight", &CApplication::GetHeight)
- ];
- luabind::globals(pLuaState)["Application"] = this;
This works great, I guess luabind automatically matches my CApplication instance to the CApplication Definition exposed to Lua. Several of my systems are Singleton Classes so I have been passing in the 'this' pointer right from the constructor.
In the Lua Scripting Chapter there was a small section called Internal Script Exports, I was not completely sure what this was, but just to clarify, this is a central spot to put all the Lua Exposures rather then putting them right in the classes constructor?
PC - Custom Built
CPU: 3rd Gen. Intel i7 3770 3.4Ghz
GPU: ATI Radeon HD 7959 3GB
RAM: 16GB
Laptop - Alienware M17x
CPU: 3rd Gen. Intel i7 - Ivy Bridge
GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
RAM: 8GB Dual Channel DDR3 @ 1600mhz
CPU: 3rd Gen. Intel i7 3770 3.4Ghz
GPU: ATI Radeon HD 7959 3GB
RAM: 16GB
Laptop - Alienware M17x
CPU: 3rd Gen. Intel i7 - Ivy Bridge
GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
RAM: 8GB Dual Channel DDR3 @ 1600mhz