]> git.mxchange.org Git - flightgear.git/commitdiff
Use the prefered GLUT game_mode_string format and add the posibility to match the...
authorehofman <ehofman>
Sun, 27 Nov 2005 10:27:55 +0000 (10:27 +0000)
committerehofman <ehofman>
Sun, 27 Nov 2005 10:27:55 +0000 (10:27 +0000)
src/Main/fg_os.cxx

index b13cd2e7159f27fe5100d0dcdeb0793de889f88e..d09cba330a4bee7b612dcc5a844c00c87b96089c 100644 (file)
@@ -198,8 +198,14 @@ void fgOSOpenWindow(int w, int h, int bpp, bool alpha,
     if(!fgGetBool("/sim/startup/game-mode")) {
         glutCreateWindow("FlightGear");
     } else {
-        char game_mode_str[256];
-        sprintf(game_mode_str, "width=%d height=%d bpp=%d", w, h, bpp);
+        char game_mode_str[20];
+        SGPropertyNode *p = fgGetNode("/sim/frame-rate-throttle-hz", false);
+        if (p) {
+            int hz = p->getIntValue();
+            snprintf(game_mode_str, 20, "%dx%d:%d@%d", w, h, bpp, hz);
+        } else {
+            snprintf(game_mode_str, 20, "%dx%d:%d", w, h, bpp);
+        }
         glutGameModeString( game_mode_str );
         glutEnterGameMode();
     }