]> git.mxchange.org Git - flightgear.git/commitdiff
Try to detect Mesa/Glide/Voodoo and chose the appropriate resolution.
authorcurt <curt>
Fri, 20 Nov 1998 01:02:35 +0000 (01:02 +0000)
committercurt <curt>
Fri, 20 Nov 1998 01:02:35 +0000 (01:02 +0000)
Main/GLUTmain.cxx
Main/fg_init.cxx
Main/options.hxx

index f671e3328e516f0f3d373ea484b5df995e977f9c..d42b4a815c897fd7859b09eace6cae35760c4357 100644 (file)
@@ -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.
index beed3c41fce24cfd33330372a2c53bec6219817f..7af55d8c25d44541e1de43b47f1056133e6cc0c2 100644 (file)
@@ -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.
index 5132759be6fec5d2a50b23ed9e1ee1c547951e75..fbfa4c9713bdb035d2617164ae82f2c685d4b3f1 100644 (file)
@@ -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.