From 2a205e2998c99340b02dbe5060b3c566d97789ba Mon Sep 17 00:00:00 2001 From: andreja6 Date: Wed, 11 Apr 2018 09:13:48 -0700 Subject: [PATCH] Made title of window dynamic --- main.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 59c4097..423b84b 100644 --- a/main.cpp +++ b/main.cpp @@ -18,6 +18,7 @@ #error Requires G3D 6.10 #endif static const float VNUM = 0.01F; +static std::string title = ""; static const std::string VERSION = "PRE-ALPHA "; static std::vector instances; static Instance* dataModel; @@ -116,9 +117,10 @@ void Demo::onInit() { app->debugCamera.setPosition(Vector3(0, 2, 10)); app->debugCamera.lookAt(Vector3(0, 2, 0)); //std::string str = "Dynamica Duomillenium 5 Version " + VERSION + Convert(VNUM); - std::string str = "Game \"" + dataModel->name + "\""; + //title = dataModel->name; + + - app->renderDevice->setCaption(str); GApplet::onInit(); } @@ -155,7 +157,11 @@ void Demo::onNetwork() { void Demo::onSimulation(RealTime rdt, SimTime sdt, SimTime idt) { - + if(dataModel->name != title) + { + title = dataModel->name; + app->renderDevice->setCaption("Game \"" + title + "\""); + } }