]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/FGEventHandler.hxx
Hopefully fix the shadow disappearing because of range animation issue in a more...
[flightgear.git] / src / Main / FGEventHandler.hxx
index 4be0caf2135676f0d87c62cad76a61aa2b77a529..3abea015e61d1855d6a63882b326c17a96db5b59 100644 (file)
@@ -5,11 +5,26 @@
 #include <osg/Quat>
 #include <osgGA/GUIEventHandler>
 #include <osgViewer/ViewerEventHandlers>
+#include <simgear/structure/OSGVersion.hxx>
 
 #include "fg_os.hxx"
 
 namespace flightgear
 {
+    class FGStatsHandler : public osgViewer::StatsHandler
+    {
+        public:
+            FGStatsHandler()
+            {
+#if (SG_OSG_VERSION >= 30000)
+                // Adjust font type/size for >=OSG3.
+                // OSG defaults aren't working/available for FG.
+                _font = "Fonts/helvetica_medium.txf";
+                _characterSize = 12.0f;
+#endif
+            }
+    };
+
 class FGEventHandler : public osgGA::GUIEventHandler {
 public:
     FGEventHandler();
@@ -86,7 +101,7 @@ protected:
     fgKeyHandler keyHandler;
     fgMouseClickHandler mouseClickHandler;
     fgMouseMotionHandler mouseMotionHandler;
-    osg::ref_ptr<osgViewer::StatsHandler> statsHandler;
+    osg::ref_ptr<FGStatsHandler> statsHandler;
     osg::ref_ptr<osgGA::GUIEventAdapter> statsEvent;
     int statsType;
     int currentModifiers;