From e80e60ab7e24c958e6773ef204044eb346dc62e2 Mon Sep 17 00:00:00 2001 From: ehofman Date: Sun, 27 Nov 2005 10:27:55 +0000 Subject: [PATCH] Use the prefered GLUT game_mode_string format and add the posibility to match the screen refresh rate and the framerate. --- src/Main/fg_os.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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(); } -- 2.39.5