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:
parent
388ddb244f
commit
e80e60ab7e
1 changed files with 8 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue