From 4fee7f9df23d2c22e5129c5f4549c8d7c3a9840f Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 9 Nov 1998 23:39:22 +0000 Subject: [PATCH] Tweaks for the instrument panel. --- Main/GLUTmain.cxx | 19 +++++++------------ Main/views.cxx | 18 +++++++++++++++++- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/Main/GLUTmain.cxx b/Main/GLUTmain.cxx index b913e7557..4de2b3ad0 100644 --- a/Main/GLUTmain.cxx +++ b/Main/GLUTmain.cxx @@ -350,13 +350,10 @@ static void fgRenderFrame( void ) { if ( (iteration == 0) && (current_options.get_panel_status()) ) { // Did we run this loop before ?? ...and do we need the panel ?? - fgPanelReInit(); + fgPanelReInit(0, 0, 1024, 768); } // display HUD && Panel - if ( current_options.get_panel_status() ) { - xglViewport(0, 0, v->winWidth, v->winHeight); - } fgCockpitUpdate(); iteration = 1; // don't ReInit the panel in the future @@ -747,7 +744,7 @@ static void fgReshape( int width, int height ) { if ( ! current_options.get_panel_status() ) { v->win_ratio = (GLfloat) width / (GLfloat) height; } else { - v->win_ratio = (GLfloat) width / ((GLfloat) (height)*0.67); + v->win_ratio = (GLfloat) width / ((GLfloat) (height)*0.4232); } } @@ -762,7 +759,7 @@ static void fgReshape( int width, int height ) { // the system. v->UpdateViewParams(); if ( current_options.get_panel_status() ) { - fgPanelReInit(); + fgPanelReInit(0, 0, 1024, 768); } } @@ -777,12 +774,7 @@ int fgGlutInit( int *argc, char **argv ) { xglutInit(argc, argv); // Define Display Parameters - if ( ! current_options.get_panel_status() ) { - xglutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE ); - } else { - xglutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE | - GLUT_STENCIL); - } + xglutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE ); // Define initial window size xglutInitWindowSize(640, 480); @@ -899,6 +891,9 @@ int main( int argc, char **argv ) { // $Log$ +// Revision 1.65 1998/11/09 23:39:22 curt +// Tweaks for the instrument panel. +// // Revision 1.64 1998/11/07 19:07:09 curt // Enable release builds using the --without-logging option to the configure // script. Also a couple log message cleanups, plus some C to C++ comment diff --git a/Main/views.cxx b/Main/views.cxx index e9885efa4..324cfff37 100644 --- a/Main/views.cxx +++ b/Main/views.cxx @@ -28,6 +28,7 @@ #endif #include +#include #include #include #include @@ -192,6 +193,11 @@ void fgVIEW::UpdateViewParams( void ) { UpdateViewMath(f); UpdateWorldToEye(f); + + if ((current_options.get_panel_status() != panel_hist) && (current_options.get_panel_status())) + { + fgPanelReInit( 0, 0, 1024, 768); + } // if (!o->panel_status) { // xglViewport( 0, (GLint)((winHeight) / 2 ) , @@ -201,7 +207,12 @@ void fgVIEW::UpdateViewParams( void ) { // xglLoadIdentity(); // gluPerspective(o->fov, win_ratio / 2.0, 1.0, 100000.0); // } else { - xglViewport(0, 0 , (GLint)(winWidth), (GLint)(winHeight) ); + if ( ! current_options.get_panel_status() ) { + xglViewport(0, 0 , (GLint)(winWidth), (GLint)(winHeight) ); + } else { + xglViewport(0, (GLint)((winHeight)*0.5768), (GLint)(winWidth), + (GLint)((winHeight)*0.4232) ); + } // Tell GL we are about to modify the projection parameters xglMatrixMode(GL_PROJECTION); xglLoadIdentity(); @@ -246,6 +257,8 @@ void fgVIEW::UpdateViewParams( void ) { // set the sun position xglLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec ); + + panel_hist = current_options.get_panel_status(); } @@ -586,6 +599,9 @@ fgVIEW::~fgVIEW( void ) { // $Log$ +// Revision 1.26 1998/11/09 23:39:25 curt +// Tweaks for the instrument panel. +// // Revision 1.25 1998/11/06 21:18:15 curt // Converted to new logstream debugging facility. This allows release // builds with no messages at all (and no performance impact) by using -- 2.39.2