diff options
Diffstat (limited to 'src/client/main.cpp')
| -rw-r--r-- | src/client/main.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/client/main.cpp b/src/client/main.cpp index fbe707b..9c22567 100644 --- a/src/client/main.cpp +++ b/src/client/main.cpp @@ -5,6 +5,7 @@ extern "C" { #include <lauxlib.h> #include <lualib.h> } +#define _IRR_STATIC_LIB_ #include <irrlicht.h> #include <chrono> @@ -109,7 +110,7 @@ int setbackgroundcolor(lua_State* L){ } int main(int argc, char *argv[]){ - printf("Brok[en]gine Client"); + printf("Brok[en]gine Client\n"); // Initialize bullet phys_genesis(); @@ -120,11 +121,14 @@ int main(int argc, char *argv[]){ loadLLibs(state); //Defined in initdevice.cpp, creates the irrlicht device device = spawnIrrDevice(state); + ILogger* log = device->getLogger(); + log->setLogLevel(ELL_NONE); if (!device) return 1; //Loads libraries for interfaceing with irrlicht loadIrrLibs(state,device); loadNetLibs(state); + luaL_openlibs(state); printf("Loadded irr libs...\n"); //Sets the global event handeler GlobalEventReceiver ger = GlobalEventReceiver(device); @@ -138,13 +142,13 @@ int main(int argc, char *argv[]){ //Load some bullet physics stuff //Load some menu - loadMenu("Some menu",device); + //loadMenu("Some menu",device); driver = device->getVideoDriver(); ISceneManager* smgr = device->getSceneManager(); IGUIEnvironment* guienv = device->getGUIEnvironment(); - device->setWindowCaption(L"Brok[en]gine Client"); + device->setWindowCaption(L"Brok[en]gine Client v0.1\n"); printf("Everything registered, about to start running device!\n"); @@ -164,6 +168,16 @@ int main(int argc, char *argv[]){ //UpdatePhysics(steps,UpdateElement); //t1 = now; driver->beginScene(true, true, background); + + lua_getglobal(state,"GAME"); + lua_getfield(state,-1,"draw"); + if(!lua_isnil(state,-1)){ + lua_call(state,0,0); + lua_pop(state,1); + }else{ + lua_pop(state,2); + } + smgr->drawAll(); guienv->drawAll(); driver->endScene(); |
