]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/panel.cxx
Remove hard-coded values wherever possible;
[flightgear.git] / src / Cockpit / panel.cxx
index 9c39626ee6bd1dd4250047400a198064a1169b36..6cdce3d70f41f1a41ad8f44ad82c156852a31151 100644 (file)
@@ -40,6 +40,7 @@
 #include <osg/CullFace>
 #include <osg/Depth>
 #include <osg/Material>
+#include <osg/Matrixf>
 #include <osg/TexEnv>
 #include <osg/PolygonOffset>
 
 #include <Main/fg_props.hxx>
 #include <Main/viewmgr.hxx>
 #include <Time/light.hxx>
-#include <GUI/new_gui.hxx>     // FGFontCache
+#include <GUI/FGFontCache.hxx> 
 #include <Main/viewer.hxx>
 #include <Instrumentation/dclgps.hxx>
 
-#include "hud.hxx"
-
-
 #define WIN_X 0
 #define WIN_Y 0
 #define WIN_W 1024
@@ -73,6 +71,8 @@
 // my hardware/driver requires many more.
 #define POFF_UNITS 8
 
+using std::map;
+
 ////////////////////////////////////////////////////////////////////////
 // Local functions.
 ////////////////////////////////////////////////////////////////////////
@@ -273,6 +273,7 @@ FGPanel::update (double dt)
 void
 FGPanel::update (osg::State& state, GLfloat winx, GLfloat winw, GLfloat winy, GLfloat winh)
 {
+  using namespace osg;
                                // Calculate accelerations
                                // and jiggle the panel accordingly
                                // The factors and bounds are just
@@ -284,12 +285,13 @@ FGPanel::update (osg::State& state, GLfloat winx, GLfloat winw, GLfloat winy, GL
 
   glMatrixMode(GL_PROJECTION);
   glPushMatrix();
-  glLoadIdentity();
+  Matrixf proj;
   if ( _flipx->getBoolValue() ) {
-    gluOrtho2D(winx + winw, winx, winy + winh, winy); /* up side down */
+      proj = Matrixf::ortho2D(winx + winw, winx, winy + winh, winy); /* up side down */
   } else {
-    gluOrtho2D(winx, winx + winw, winy, winy + winh); /* right side up */
+      proj = Matrixf::ortho2D(winx, winx + winw, winy, winy + winh); /* right side up */
   }
+  glLoadMatrix(proj.ptr());
   
   glMatrixMode(GL_MODELVIEW);
   glPushMatrix();