#19261 - Add startup time to the main window title, fit to screen

This commit is contained in:
stojce 2013-04-16 02:24:38 +02:00
parent fc8c0498cf
commit 39df647dcb

View file

@ -893,9 +893,11 @@ void display(void)
// If application has just started, report time from startup to now (first frame display)
if (justStarted) {
printf("Startup Time: %4.2f\n",
(usecTimestampNow() - usecTimestamp(&applicationStartupTime))/1000000.0);
float startupTime = (usecTimestampNow() - usecTimestamp(&applicationStartupTime))/1000000.0;
justStarted = false;
char title[30];
sprintf(title, "Interface: %4.2f seconds", startupTime);
glutSetWindowTitle(title);
}
}
@ -1463,6 +1465,9 @@ int main(int argc, const char * argv[])
AgentList::getInstance()->startPingUnknownAgentsThread();
glutInit(&argc, (char**)argv);
WIDTH = glutGet (GLUT_SCREEN_WIDTH);
HEIGHT = glutGet (GLUT_SCREEN_HEIGHT);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH);
glutInitWindowSize(WIDTH, HEIGHT);
glutCreateWindow("Interface");