]> git.mxchange.org Git - flightgear.git/commitdiff
Norman has brought back the fancy frame rate counter as an option.
authorcurt <curt>
Thu, 6 May 1999 21:13:40 +0000 (21:13 +0000)
committercurt <curt>
Thu, 6 May 1999 21:13:40 +0000 (21:13 +0000)
Include/general.hxx

index 99b28ad30f9fe02363fbc6acb930e79c54c24c90..9d7fecb6da45b464d7fca7d2efd08310a9d7e359 100644 (file)
 #endif                                   
 
 
-// #define FG_FRAME_RATE_HISTORY 10
+// #define FANCY_FRAME_COUNTER
+#ifdef FANCY_FRAME_COUNTER
+#define FG_FRAME_RATE_HISTORY 10
+#endif
 
 
 // the general house keeping structure definition
@@ -44,7 +47,9 @@ class FGGeneral {
 
     // Last frame rate measurement
     int frame_rate;
-    // double frames[FG_FRAME_RATE_HISTORY];
+#ifdef FANCY_FRAME_COUNTER
+    double frames[FG_FRAME_RATE_HISTORY];
+#endif
 
 public:
 
@@ -53,7 +58,13 @@ public:
     inline void set_glRenderer( char *str ) { glRenderer = str; }
     inline void set_glVersion( char *str ) { glVersion = str; }
     inline double get_frame_rate() const { return frame_rate; }
+#ifdef FANCY_FRAME_COUNTER
+    inline double get_frame(int idx) const { return frames[idx]; }
+    inline void set_frame( int idx, double value ) { frames[idx] = value; }
+    inline void set_frame_rate( double rate ) { frame_rate = rate; }
+#else
     inline void set_frame_rate( int rate ) { frame_rate = rate; }
+#endif
 };
 
 // general contains all the general house keeping parameters.