Changeset 1807 for code/branches
- Timestamp:
- Sep 21, 2008, 7:13:06 PM (16 years ago)
- Location:
- code/branches/ceguilua/src/ceguilua-0.5.0b/ceguilua
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ceguilua/src/ceguilua-0.5.0b/ceguilua/CEGUILua.cpp
r1803 r1807 35 35 36 36 // include Lua libs and tolua++ 37 extern "C" { 38 #include "lua.h" 39 #include "lualib.h" 40 #include "lauxlib.h" 41 } 37 #include "lua/lua.hpp" 38 #include "tolua/tolua++.h" 42 39 43 40 #include "tolua++.h" … … 56 53 LuaScriptModule::LuaScriptModule() 57 54 { 58 // create a lua state 59 d_ownsState = true; 60 d_state = lua_open(); 61 62 // init all standard libraries 63 luaopen_base(d_state); 64 luaopen_io(d_state); 65 luaopen_string(d_state); 66 luaopen_table(d_state); 67 luaopen_math(d_state); 68 #if defined(DEBUG) || defined (_DEBUG) 69 luaopen_debug(d_state); 70 #endif 71 72 setModuleIdentifierString(); 55 static const luaL_Reg lualibs[] = { 56 {"", luaopen_base}, 57 {LUA_LOADLIBNAME, luaopen_package}, 58 {LUA_TABLIBNAME, luaopen_table}, 59 {LUA_IOLIBNAME, luaopen_io}, 60 {LUA_OSLIBNAME, luaopen_os}, 61 {LUA_STRLIBNAME, luaopen_string}, 62 {LUA_MATHLIBNAME, luaopen_math}, 63 #if defined(DEBUG) || defined (_DEBUG) 64 {LUA_DBLIBNAME, luaopen_debug}, 65 #endif 66 {0, 0} 67 }; 68 69 // create a lua state 70 d_ownsState = true; 71 d_state = lua_open(); 72 73 // init all standard libraries 74 const luaL_Reg *lib = lualibs; 75 for (; lib->func; lib++) 76 { 77 lua_pushcfunction(d_state, lib->func); 78 lua_pushstring(d_state, lib->name); 79 lua_call(d_state, 1, 0); 80 } 81 82 setModuleIdentifierString(); 73 83 } 74 84 -
code/branches/ceguilua/src/ceguilua-0.5.0b/ceguilua/CEGUILuaFunctor.cpp
r1803 r1807 34 34 35 35 // include Lua libs and tolua++ 36 extern "C" { 37 #include "lua.h" 38 #include "lualib.h" 39 #include "lauxlib.h" 40 } 41 42 #include "tolua++.h" 36 #include "lua/lua.hpp" 37 #include "tolua/tolua++.h" 43 38 44 39 // Start of CEGUI namespace section -
code/branches/ceguilua/src/ceguilua-0.5.0b/ceguilua/lua_CEGUI.cpp
r1803 r1807 9 9 #include "string.h" 10 10 11 #include "tolua ++.h"11 #include "tolua/tolua++.h" 12 12 13 13 /* Exported function */
Note: See TracChangeset
for help on using the changeset viewer.