From 732282a357bf74a803f929eba3af5637073da56f Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 20 Nov 1998 01:02:35 +0000 Subject: [PATCH] Try to detect Mesa/Glide/Voodoo and chose the appropriate resolution. --- Main/GLUTmain.cxx | 42 +++++++++++++++++++++++++++++++++++++++++- Main/fg_init.cxx | 12 ++++-------- Main/options.hxx | 5 +++++ 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/Main/GLUTmain.cxx b/Main/GLUTmain.cxx index f671e3328..d42b4a815 100644 --- a/Main/GLUTmain.cxx +++ b/Main/GLUTmain.cxx @@ -807,6 +807,7 @@ static void fgReshape( int width, int height ) { v->winWidth = width; v->winHeight = height; + v->update_fov = true; // Inform gl of our view window size (now handled elsewhere) // xglViewport(0, 0, (GLint)width, (GLint)height); @@ -899,7 +900,43 @@ int main( int argc, char **argv ) { // set default log levels fglog().setLogLevels( FG_ALL, FG_INFO ); - FG_LOG( FG_GENERAL, FG_INFO, "Flight Gear: Version" << VERSION << endl ); + FG_LOG( FG_GENERAL, FG_INFO, "Flight Gear: Version " << VERSION << endl ); + + string root; + int i; + + FG_LOG( FG_GENERAL, FG_INFO, "General Initialization" ); + FG_LOG( FG_GENERAL, FG_INFO, "======= ==============" ); + + // pull some basic driver info + general.glVendor = (char *)glGetString ( GL_VENDOR ); + general.glRenderer = (char *)glGetString ( GL_RENDERER ); + general.glVersion = (char *)glGetString ( GL_VERSION ); + + // try to determine if we should adjust the default display + // resolution. The options class defaults (is initialized) to + // 640x480. + string renderer = general.glRenderer; + + // currently we only know how to deal with Mesa/Glide/Voodoo cards + if ( renderer.find( "Glide" ) != string::npos ) { + if ( renderer.find( "FB/8" ) != string::npos ) { + // probably a voodoo-2 + if ( renderer.find( "TMU/SLI" ) != string::npos ) { + // probably two SLI'd Voodoo-2's + current_options.set_xsize( 1024 ); + current_options.set_ysize( 768 ); + } else { + // probably a single non-SLI'd Voodoo-2 + current_options.set_xsize( 800 ); + current_options.set_ysize( 600 ); + } + } else if ( renderer.find( "FB/2" ) != string::npos ) { + // probably a voodoo-1, stick with the default + } + } else { + // we have no special knowledge of this card, stick with the default + } // Attempt to locate and parse a config file // First check fg_root @@ -960,6 +997,9 @@ int main( int argc, char **argv ) { // $Log$ +// Revision 1.68 1998/11/20 01:02:35 curt +// Try to detect Mesa/Glide/Voodoo and chose the appropriate resolution. +// // Revision 1.67 1998/11/16 13:59:58 curt // Added pow() macro bug work around. // Added support for starting FGFS at various resolutions. diff --git a/Main/fg_init.cxx b/Main/fg_init.cxx index beed3c41f..7af55d8c2 100644 --- a/Main/fg_init.cxx +++ b/Main/fg_init.cxx @@ -123,19 +123,12 @@ int fgInitPosition( void ) { // General house keeping initializations int fgInitGeneral( void ) { - fgGENERAL *g; string root; int i; - g = &general; - FG_LOG( FG_GENERAL, FG_INFO, "General Initialization" ); FG_LOG( FG_GENERAL, FG_INFO, "======= ==============" ); - g->glVendor = (char *)glGetString ( GL_VENDOR ); - g->glRenderer = (char *)glGetString ( GL_RENDERER ); - g->glVersion = (char *)glGetString ( GL_VERSION ); - root = current_options.get_fg_root(); if ( ! root.length() ) { // No root path set? Then bail ... @@ -148,7 +141,7 @@ int fgInitGeneral( void ) { // prime the frame rate counter pump for ( i = 0; i < FG_FRAME_RATE_HISTORY; i++ ) { - g->frames[i] = 0.0; + general.frames[i] = 0.0; } return ( 1 ); @@ -381,6 +374,9 @@ int fgInitSubsystems( void ) // $Log$ +// Revision 1.51 1998/11/20 01:02:37 curt +// Try to detect Mesa/Glide/Voodoo and chose the appropriate resolution. +// // Revision 1.50 1998/11/16 14:00:01 curt // Added pow() macro bug work around. // Added support for starting FGFS at various resolutions. diff --git a/Main/options.hxx b/Main/options.hxx index 5132759be..fbfa4c971 100644 --- a/Main/options.hxx +++ b/Main/options.hxx @@ -221,6 +221,8 @@ public: xglHint ( GL_FOG_HINT, GL_FASTEST ); } } + inline void set_xsize( int x ) { xsize= x; } + inline void set_ysize( int y ) { xsize= y; } private: @@ -241,6 +243,9 @@ extern fgOPTIONS current_options; // $Log$ +// Revision 1.22 1998/11/20 01:02:38 curt +// Try to detect Mesa/Glide/Voodoo and chose the appropriate resolution. +// // Revision 1.21 1998/11/16 14:00:04 curt // Added pow() macro bug work around. // Added support for starting FGFS at various resolutions. -- 2.39.2