]> git.mxchange.org Git - flightgear.git/commitdiff
Patch to allow window resizes.
authorcurt <curt>
Tue, 31 Aug 1999 23:22:05 +0000 (23:22 +0000)
committercurt <curt>
Tue, 31 Aug 1999 23:22:05 +0000 (23:22 +0000)
src/Main/main.cxx
src/Main/options.cxx

index 9eab93ed863b94f32bd53cc282cc0ec4906c5d6b..8820f7f6d8ceb0701f9118f74cd7b6d1dc2367ef 100644 (file)
@@ -908,6 +908,8 @@ void fgReshape( int width, int height ) {
     current_view.set_winHeight( height );
     current_view.force_update_fov_math();
 
+    glViewport ( 0, 0, width, height );
+
     if ( idle_state == 1000 ) {
        // yes we've finished all our initializations and are running
        // the main loop, so this will now work without seg faulting
index 2fbced19da07c8f6d91dbef2748dc76fee5383ca..8e947097380a2061ba67c0f92eb33ee9ea035282 100644 (file)
@@ -670,20 +670,29 @@ int fgOPTIONS::parse_option( const string& arg ) {
     } else if ( arg == "--enable-wireframe" ) {
        wireframe = true;
     } else if ( arg.find( "--geometry=" ) != string::npos ) {
+       bool geometry_ok = true;
        string geometry = arg.substr( 11 );
-       if ( geometry == "640x480" ) {
+       string::size_type i = geometry.find('x');
+
+       if (i != string::npos) {
+           xsize = atoi(geometry.substr(0, i));
+           ysize = atoi(geometry.substr(i+1));
+           // cout << "Geometry is " << xsize << 'x' << ysize << '\n';
+       } else {
+           geometry_ok = false;
+       }
+
+       if ( xsize <= 0 || ysize <= 0 ) {
            xsize = 640;
            ysize = 480;
-       } else if ( geometry == "800x600" ) {
-           xsize = 800;
-           ysize = 600;
-       } else if ( geometry == "1024x768" ) {
-           xsize = 1024;
-           ysize = 768;
-       } else {
-           FG_LOG( FG_GENERAL, FG_ALERT, "Unknown geometry: " << geometry );
-           exit(-1);
-       }
+           geometry_ok = false;
+       }
+
+       if ( !geometry_ok ) {
+           FG_LOG( FG_GENERAL, FG_ALERT, "Unknown geometry: " << geometry );
+           FG_LOG( FG_GENERAL, FG_ALERT,
+                   "Setting geometry to " << xsize << 'x' << ysize << '\n');
+       }
     } else if ( arg == "--units-feet" ) {
        units = FG_UNITS_FEET;  
     } else if ( arg == "--units-meters" ) {