aboutsummaryrefslogtreecommitdiff
path: root/src/client/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/main.cpp')
-rw-r--r--src/client/main.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/client/main.cpp b/src/client/main.cpp
index 54aafc0..fbe707b 100644
--- a/src/client/main.cpp
+++ b/src/client/main.cpp
@@ -98,6 +98,16 @@ void UpdateElement(btRigidBody* TObject){
}
+SColor background = SColor(255,100,101,140);
+
+//setbackgroundcolor(r,g,b)
+int setbackgroundcolor(lua_State* L){
+ long r,g,b;
+ popvector3i(L,&r,&g,&b);
+ background = SColor(255,r,g,b);
+ return 0;
+}
+
int main(int argc, char *argv[]){
printf("Brok[en]gine Client");
// Initialize bullet
@@ -140,6 +150,10 @@ int main(int argc, char *argv[]){
//u32 TimeStamp = irrTimer->getTime(), DeltaTime = 0;
//high_resolution_clock::time_point t1 = high_resolution_clock::now();
+ lua_getglobal(L,"GAME");
+ lua_pushcfunction(L,setbackgroundcolor);
+ lua_setfield(L,-2,"setbackgroundcolor");
+ lua_pop(L,1);
while(device->run()){
gameloop_net(L);
gameloop_phys(UpdateElement);
@@ -149,7 +163,7 @@ int main(int argc, char *argv[]){
//double steps = delta.count() * 100;
//UpdatePhysics(steps,UpdateElement);
//t1 = now;
- driver->beginScene(true, true, SColor(255,100,101,140));
+ driver->beginScene(true, true, background);
smgr->drawAll();
guienv->drawAll();
driver->endScene();