Re-enable glut game mode for now
This commit is contained in:
parent
2acdd02879
commit
ae2dbe4f25
3 changed files with 13 additions and 3 deletions
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
#include <plib/pu.h>
|
#include <plib/pu.h>
|
||||||
|
|
||||||
|
#include "fg_props.hxx"
|
||||||
#include "fg_os.hxx"
|
#include "fg_os.hxx"
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -176,14 +177,21 @@ void fgRequestRedraw()
|
||||||
glutPostRedisplay();
|
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;
|
int mode = GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE;
|
||||||
if(alpha) mode |= GLUT_ALPHA;
|
if(alpha) mode |= GLUT_ALPHA;
|
||||||
|
|
||||||
glutInitDisplayMode(mode);
|
glutInitDisplayMode(mode);
|
||||||
glutInitWindowSize(w, h);
|
glutInitWindowSize(w, h);
|
||||||
|
if(!fgGetBool("/sim/startup/game-mode")) {
|
||||||
glutCreateWindow("FlightGear");
|
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
|
// Register these here. Calling them before the window is open
|
||||||
// crashes.
|
// crashes.
|
||||||
|
@ -197,4 +205,5 @@ void fgOSOpenWindow(int w, int h, bool alpha)
|
||||||
glutIdleFunc(GLUTidle);
|
glutIdleFunc(GLUTidle);
|
||||||
glutDisplayFunc(GLUTdraw);
|
glutDisplayFunc(GLUTdraw);
|
||||||
glutReshapeFunc(GLUTreshape);
|
glutReshapeFunc(GLUTreshape);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ enum { KEYMOD_NONE = 0,
|
||||||
//
|
//
|
||||||
|
|
||||||
void fgOSInit(int* argc, char** argv);
|
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 fgOSFullScreen();
|
||||||
void fgOSMainLoop();
|
void fgOSMainLoop();
|
||||||
|
|
||||||
|
|
|
@ -1412,6 +1412,7 @@ bool fgMainInit( int argc, char **argv ) {
|
||||||
// Clouds3D requires an alpha channel
|
// Clouds3D requires an alpha channel
|
||||||
fgOSOpenWindow( fgGetInt("/sim/startup/xsize"),
|
fgOSOpenWindow( fgGetInt("/sim/startup/xsize"),
|
||||||
fgGetInt("/sim/startup/ysize"),
|
fgGetInt("/sim/startup/ysize"),
|
||||||
|
fgGetInt("/sim/rendering/bits-per-pixel"),
|
||||||
fgGetBool("/sim/rendering/clouds3d") );
|
fgGetBool("/sim/rendering/clouds3d") );
|
||||||
|
|
||||||
// This seems to be the absolute earliest in the init sequence
|
// This seems to be the absolute earliest in the init sequence
|
||||||
|
|
Loading…
Add table
Reference in a new issue