1
0
Fork 0

Patch to allow window resizes.

This commit is contained in:
curt 1999-08-31 23:22:05 +00:00
parent c664ec4e93
commit 0f6565f764
2 changed files with 22 additions and 11 deletions

View file

@ -908,6 +908,8 @@ void fgReshape( int width, int height ) {
current_view.set_winHeight( height ); current_view.set_winHeight( height );
current_view.force_update_fov_math(); current_view.force_update_fov_math();
glViewport ( 0, 0, width, height );
if ( idle_state == 1000 ) { if ( idle_state == 1000 ) {
// yes we've finished all our initializations and are running // yes we've finished all our initializations and are running
// the main loop, so this will now work without seg faulting // the main loop, so this will now work without seg faulting

View file

@ -670,20 +670,29 @@ int fgOPTIONS::parse_option( const string& arg ) {
} else if ( arg == "--enable-wireframe" ) { } else if ( arg == "--enable-wireframe" ) {
wireframe = true; wireframe = true;
} else if ( arg.find( "--geometry=" ) != string::npos ) { } else if ( arg.find( "--geometry=" ) != string::npos ) {
bool geometry_ok = true;
string geometry = arg.substr( 11 ); 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; xsize = 640;
ysize = 480; ysize = 480;
} else if ( geometry == "800x600" ) { geometry_ok = false;
xsize = 800; }
ysize = 600;
} else if ( geometry == "1024x768" ) { if ( !geometry_ok ) {
xsize = 1024; FG_LOG( FG_GENERAL, FG_ALERT, "Unknown geometry: " << geometry );
ysize = 768; FG_LOG( FG_GENERAL, FG_ALERT,
} else { "Setting geometry to " << xsize << 'x' << ysize << '\n');
FG_LOG( FG_GENERAL, FG_ALERT, "Unknown geometry: " << geometry ); }
exit(-1);
}
} else if ( arg == "--units-feet" ) { } else if ( arg == "--units-feet" ) {
units = FG_UNITS_FEET; units = FG_UNITS_FEET;
} else if ( arg == "--units-meters" ) { } else if ( arg == "--units-meters" ) {