1
0
Fork 0

Use the prefered GLUT game_mode_string format and add the posibility to match the screen refresh rate and the framerate.

This commit is contained in:
ehofman 2005-11-27 10:27:55 +00:00
parent 388ddb244f
commit e80e60ab7e

View 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();
}