From: ehofman Date: Sun, 27 Nov 2005 10:27:55 +0000 (+0000) Subject: Use the prefered GLUT game_mode_string format and add the posibility to match the... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e80e60ab7e24c958e6773ef204044eb346dc62e2;p=flightgear.git Use the prefered GLUT game_mode_string format and add the posibility to match the screen refresh rate and the framerate. --- diff --git a/src/Main/fg_os.cxx b/src/Main/fg_os.cxx index b13cd2e71..d09cba330 100644 --- a/src/Main/fg_os.cxx +++ b/src/Main/fg_os.cxx @@ -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(); }