diff options
| author | Alexander Pickering <alex@cogarr.net> | 2018-06-23 06:52:55 -0600 |
|---|---|---|
| committer | Alexander Pickering <alex@cogarr.net> | 2018-06-23 06:52:55 -0600 |
| commit | e6faff1394864a1fe0d517584d1c104997dff39f (patch) | |
| tree | d7956fc8aabef903f354578d69d4d7fdf64ec928 /src/client/main.cpp | |
| parent | 1aaa348ac080c97c0aeb0a02146ae26b74add5a1 (diff) | |
| parent | 9fa5dcc9310a8c6ff8c77a47a86303f7b950dcf3 (diff) | |
| download | brokengine-e6faff1394864a1fe0d517584d1c104997dff39f.tar.gz brokengine-e6faff1394864a1fe0d517584d1c104997dff39f.tar.bz2 brokengine-e6faff1394864a1fe0d517584d1c104997dff39f.zip | |
Merge branch 'master' of ssh://cogarr.net:43/home/git/brokengine
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(); |
