Changing window title and moving fps display to debug build.

This commit is contained in:
Faerbit 2015-03-15 22:32:13 +01:00
parent 0ae43db53e
commit 5f0e5cf623

View File

@ -158,9 +158,6 @@ int main( int argc, char *argv[] )
exit( -1 );
}
// Set window title to binary name (without the path):
std::vector<std::string> tmp = ACGL::Utils::StringHelpers::split( std::string( argv[0] ), '/' );
glfwSetWindowTitle(window, tmp[tmp.size()-1].c_str() );
// Ensure we can capture the escape key being pressed below
glfwSetInputMode(window, GLFW_STICKY_KEYS, 1);
// set Callbacks
@ -181,7 +178,7 @@ int main( int argc, char *argv[] )
int frameCount = 0;
const double FPSdelay = 2.0;
const double FPSdelay = 1.0;
double startTimeInSeconds = glfwGetTime();
double showNextFPS = startTimeInSeconds + FPSdelay;
@ -193,14 +190,16 @@ int main( int argc, char *argv[] )
double now = glfwGetTime()- startTimeInSeconds;
#ifdef SAXUM_DEBUG
if (showNextFPS <= now) {
std::stringstream sstream (std::stringstream::in | std::stringstream::out);
sstream << std::setprecision(1) << std::fixed
<< tmp[tmp.size()-1] << " - FPS: " << frameCount / (now-showNextFPS + FPSdelay) << " " << 1000 * (now-showNextFPS + FPSdelay)/frameCount << " msec";
<< "Saxum" << " - FPS: " << frameCount / (now-showNextFPS + FPSdelay) << " " << 1000 * (now-showNextFPS + FPSdelay)/frameCount << " msec";
glfwSetWindowTitle(window, sstream.str().c_str() );
showNextFPS = now + FPSdelay;
frameCount = 0;
}
#endif
if (app.isGameStarted()) {
static float gameStart = now;
if (app.isLocked() && app.getIgnoredMouseUpdates() == 0) {