1
0
Fork 0

Added GameGLUT support.

This commit is contained in:
curt 1998-08-20 15:10:33 +00:00
parent ab51d8ca5c
commit f1b0e32e37
3 changed files with 39 additions and 12 deletions

View file

@ -833,7 +833,14 @@ int fgGlutInit( int *argc, char **argv ) {
xglutInitWindowSize(640, 480);
// Initialize windows
if ( current_options.get_game_mode() == 0 ) {
// Open the regular window
xglutCreateWindow("Flight Gear");
} else {
// Open the cool new 'game mode' window
glutGameModeString("width=640 height=480 bpp=16");
glutEnterGameMode();
}
return(1);
}
@ -881,17 +888,6 @@ int main( int argc, char **argv ) {
fgPrintf(FG_GENERAL, FG_INFO, "Flight Gear: Version %s\n\n", VERSION);
// Initialize the Window/Graphics environment.
if( !fgGlutInit(&argc, argv) ) {
fgPrintf( FG_GENERAL, FG_EXIT, "GLUT initialization failed ...\n" );
}
// Initialize the various GLUT Event Handlers.
if( !fgGlutInitEvents() ) {
fgPrintf( FG_GENERAL, FG_EXIT,
"GLUT event handler initialization failed ...\n" );
}
// Attempt to locate and parse a config file
// First check fg_root
current_options.get_fg_root(config);
@ -915,6 +911,17 @@ int main( int argc, char **argv ) {
fgPrintf( FG_GENERAL, FG_EXIT, "\nExiting ...\n");
}
// Initialize the Window/Graphics environment.
if( !fgGlutInit(&argc, argv) ) {
fgPrintf( FG_GENERAL, FG_EXIT, "GLUT initialization failed ...\n" );
}
// Initialize the various GLUT Event Handlers.
if( !fgGlutInitEvents() ) {
fgPrintf( FG_GENERAL, FG_EXIT,
"GLUT event handler initialization failed ...\n" );
}
// First do some quick general initializations
if( !fgInitGeneral()) {
fgPrintf( FG_GENERAL, FG_EXIT,
@ -934,6 +941,9 @@ int main( int argc, char **argv ) {
// $Log$
// Revision 1.44 1998/08/20 15:10:33 curt
// Added GameGLUT support.
//
// Revision 1.43 1998/08/12 21:01:47 curt
// Master volume from 30% -> 80%
//

View file

@ -133,6 +133,7 @@ fgOPTIONS::fgOPTIONS( void ) {
pitch = 0.424; // pitch angle in degrees (Theta)
// Miscellaneous
game_mode = 0;
splash_screen = 1;
intro_music = 1;
mouse_pointer = 0;
@ -141,6 +142,7 @@ fgOPTIONS::fgOPTIONS( void ) {
// Features
hud_status = 1;
panel_status = 0;
sound = 1;
// Flight Model options
flight_model = FG_LARCSIM;
@ -394,6 +396,10 @@ int fgOPTIONS::parse_option( char *arg ) {
(strcmp(arg, "-h") == 0) ) {
// help/usage request
return(FG_OPTIONS_HELP);
} else if ( strcmp(arg, "--disable-game-mode") == 0 ) {
game_mode = 0;
} else if ( strcmp(arg, "--enable-game-mode") == 0 ) {
game_mode = 1;
} else if ( strcmp(arg, "--disable-splash-screen") == 0 ) {
splash_screen = 0;
} else if ( strcmp(arg, "--enable-splash-screen") == 0 ) {
@ -558,6 +564,8 @@ void fgOPTIONS::usage ( void ) {
printf("General Options:\n");
printf("\t--help -h: print usage\n");
printf("\t--fg-root=path: specify the root path for all the data files\n");
printf("\t--disable-gamemode: disable full-screen game mode\n");
printf("\t--enable-gamemode: enable full-screen game mode\n");
printf("\t--disable-splash-screen: disable splash screen\n");
printf("\t--enable-splash-screen: enable splash screen\n");
printf("\t--disable-intro-music: disable introduction music\n");
@ -623,6 +631,7 @@ double fgOPTIONS::get_altitude( void ) { return(altitude); }
double fgOPTIONS::get_heading( void ) { return(heading); }
double fgOPTIONS::get_roll( void ) { return(roll); }
double fgOPTIONS::get_pitch( void ) { return(pitch); }
int fgOPTIONS::get_game_mode( void ) { return(game_mode); }
int fgOPTIONS::get_splash_screen( void ) { return(splash_screen); }
int fgOPTIONS::get_intro_music( void ) { return(intro_music); }
int fgOPTIONS::get_mouse_pointer( void ) { return(mouse_pointer); }
@ -653,6 +662,9 @@ fgOPTIONS::~fgOPTIONS( void ) {
// $Log$
// Revision 1.21 1998/08/20 15:10:34 curt
// Added GameGLUT support.
//
// Revision 1.20 1998/07/30 23:48:28 curt
// Output position & orientation when pausing.
// Eliminated libtool use.

View file

@ -52,6 +52,7 @@ class fgOPTIONS {
double pitch; // pitch angle in degrees (Theta)
// Miscellaneous
int game_mode; // Game mode enabled/disabled
int splash_screen; // show splash screen
int intro_music; // play introductory music
int mouse_pointer; // show mouse pointer
@ -111,6 +112,7 @@ public:
double get_heading( void );
double get_roll( void );
double get_pitch( void );
int get_game_mode( void );
int get_splash_screen( void );
int get_intro_music( void );
int get_mouse_pointer( void );
@ -147,6 +149,9 @@ extern fgOPTIONS current_options;
// $Log$
// Revision 1.14 1998/08/20 15:10:35 curt
// Added GameGLUT support.
//
// Revision 1.13 1998/07/30 23:48:29 curt
// Output position & orientation when pausing.
// Eliminated libtool use.