1 // general.hxx -- a general house keeping data structure definition for
2 // various info that might need to be accessible from all
5 // Written by Curtis Olson, started July 1997.
7 // Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of the
12 // License, or (at your option) any later version.
14 // This program is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // General Public License for more details.
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 # error This library requires C++
35 // #define FANCY_FRAME_COUNTER
36 #ifdef FANCY_FRAME_COUNTER
37 #define FG_FRAME_RATE_HISTORY 10
41 // the general house keeping structure definition
48 // Last frame rate measurement
50 #ifdef FANCY_FRAME_COUNTER
51 double frames[FG_FRAME_RATE_HISTORY];
56 inline void set_glVendor( char *str ) { glVendor = str; }
57 inline char* get_glRenderer() const { return glRenderer; }
58 inline void set_glRenderer( char *str ) { glRenderer = str; }
59 inline void set_glVersion( char *str ) { glVersion = str; }
60 inline double get_frame_rate() const { return frame_rate; }
61 #ifdef FANCY_FRAME_COUNTER
62 inline double get_frame(int idx) const { return frames[idx]; }
63 inline void set_frame( int idx, double value ) { frames[idx] = value; }
64 inline void set_frame_rate( double rate ) { frame_rate = rate; }
66 inline void set_frame_rate( int rate ) { frame_rate = rate; }
70 // general contains all the general house keeping parameters.
71 extern FGGeneral general;
74 #endif // _GENERAL_HXX