From ae2dbe4f25f07ee93bbadb91164d1373d8057252 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 1 Apr 2004 15:44:13 +0000 Subject: [PATCH] Re-enable glut game mode for now --- src/Main/fg_os.cxx | 13 +++++++++++-- src/Main/fg_os.hxx | 2 +- src/Main/main.cxx | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Main/fg_os.cxx b/src/Main/fg_os.cxx index 6e0d96bab..4a1eb9c0f 100644 --- a/src/Main/fg_os.cxx +++ b/src/Main/fg_os.cxx @@ -9,6 +9,7 @@ #include +#include "fg_props.hxx" #include "fg_os.hxx" // @@ -176,14 +177,21 @@ void fgRequestRedraw() glutPostRedisplay(); } -void fgOSOpenWindow(int w, int h, bool alpha) +void fgOSOpenWindow(int w, int h, int bpp, bool alpha) { int mode = GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE; if(alpha) mode |= GLUT_ALPHA; glutInitDisplayMode(mode); glutInitWindowSize(w, h); - glutCreateWindow("FlightGear"); + 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); + glutGameModeString( game_mode_str ); + glutEnterGameMode(); + } // Register these here. Calling them before the window is open // crashes. @@ -197,4 +205,5 @@ void fgOSOpenWindow(int w, int h, bool alpha) glutIdleFunc(GLUTidle); glutDisplayFunc(GLUTdraw); glutReshapeFunc(GLUTreshape); + } diff --git a/src/Main/fg_os.hxx b/src/Main/fg_os.hxx index 88525af7f..ba36a0879 100644 --- a/src/Main/fg_os.hxx +++ b/src/Main/fg_os.hxx @@ -38,7 +38,7 @@ enum { KEYMOD_NONE = 0, // void fgOSInit(int* argc, char** argv); -void fgOSOpenWindow(int w, int h, bool alpha); +void fgOSOpenWindow(int w, int h, int bpp, bool alpha); void fgOSFullScreen(); void fgOSMainLoop(); diff --git a/src/Main/main.cxx b/src/Main/main.cxx index bef186254..2cbc13538 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -1412,6 +1412,7 @@ bool fgMainInit( int argc, char **argv ) { // Clouds3D requires an alpha channel fgOSOpenWindow( fgGetInt("/sim/startup/xsize"), fgGetInt("/sim/startup/ysize"), + fgGetInt("/sim/rendering/bits-per-pixel"), fgGetBool("/sim/rendering/clouds3d") ); // This seems to be the absolute earliest in the init sequence