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.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

View file

@ -670,19 +670,28 @@ 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 {
geometry_ok = false;
}
if ( !geometry_ok ) {
FG_LOG( FG_GENERAL, FG_ALERT, "Unknown geometry: " << geometry );
exit(-1);
FG_LOG( FG_GENERAL, FG_ALERT,
"Setting geometry to " << xsize << 'x' << ysize << '\n');
}
} else if ( arg == "--units-feet" ) {
units = FG_UNITS_FEET;