1
0
Fork 0

Re-enable glut game mode for now

This commit is contained in:
andy 2004-04-01 15:44:13 +00:00
parent 2acdd02879
commit ae2dbe4f25
3 changed files with 13 additions and 3 deletions

View file

@ -9,6 +9,7 @@
#include <plib/pu.h>
#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);
}

View file

@ -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();

View file

@ -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