#include <stdlib.h>
#include <string.h>
-#include <Include/general.h>
+#include <Include/general.hxx>
#include <Main/options.hxx>
#include "gui.h"
void guiInit()
{
- fgGENERAL *g;
char *mesa_win_state;
- g = &general;
-
// Initialize PUI
puInit();
// no preference specified for mouse pointer, attempt to autodetect...
// Determine if we need to render the cursor, or if the windowing
// system will do it. First test if we are rendering with glide.
- if ( strstr ( g->glRenderer, "Glide" ) ) {
+ if ( strstr ( general.get_glRenderer(), "Glide" ) ) {
// Test for the MESA_GLX_FX env variable
if ( (mesa_win_state = getenv( "MESA_GLX_FX" )) != NULL) {
// test if we are fullscreen mesa/glide
#endif
#include <Include/fg_constants.h> // for VERSION
-#include <Include/general.h>
+#include <Include/general.hxx>
#include <Aircraft/aircraft.hxx>
#include <Astro/sky.hxx>
#include "views.hxx"
-// This is a record containing global housekeeping information
-fgGENERAL general;
+// This is a record containing a bit of global housekeeping information
+FGGeneral general;
// Specify our current idle function state. This is used to run all
// our initializations out of the glutIdleLoop() so that we can get a
// for the next move and update the display?
static void fgMainLoop( void ) {
FGState *f;
- fgGENERAL *g;
fgTIME *t;
static int remainder = 0;
int elapsed, multi_loop;
static int frames = 0;
f = current_aircraft.fdm_state;
- g = &general;
t = &cur_time_params;
FG_LOG( FG_ALL, FG_DEBUG, "Running Main Loop");
// Calculate frame rate average
if ( (t->cur_time != last_time) && (last_time > 0) ) {
- g->frame_rate = frames;
+ general.set_frame_rate( frames );
frames = 0;
}
last_time = t->cur_time;
if ( ! use_signals ) {
// Calculate model iterations needed for next frame
FG_LOG( FG_ALL, FG_DEBUG,
- "--> Frame rate is = " << g->frame_rate );
+ "--> Frame rate is = " << general.get_frame_rate() );
elapsed += remainder;
multi_loop = (int)(((float)elapsed * 0.001) * DEFAULT_MODEL_HZ);
// then on.
static void fgIdleFunction ( void ) {
- fgGENERAL *g;
- g = &general;
-
// printf("idle state == %d\n", idle_state);
if ( idle_state == 0 ) {
// "subsystems" but still need to be initialized.
#ifdef USE_GLIDE
- if ( strstr ( g->glRenderer, "Glide" ) ) {
+ if ( strstr ( general.get_glRenderer(), "Glide" ) ) {
grTexLodBiasValue ( GR_TMU0, 1.0 ) ;
}
#endif
// This seems to be the absolute earliest in the init sequence
// that these calls will return valid info. Too bad it's after
// we've already created and sized out window. :-(
- general.glVendor = (char *)glGetString ( GL_VENDOR );
- general.glRenderer = (char *)glGetString ( GL_RENDERER );
- general.glVersion = (char *)glGetString ( GL_VERSION );
+ general.set_glVendor( (char *)glGetString ( GL_VENDOR ) );
+ general.set_glRenderer( (char *)glGetString ( GL_RENDERER ) );
+ general.set_glVersion( (char *)glGetString ( GL_VERSION ) );
- FG_LOG ( FG_GENERAL, FG_INFO, general.glRenderer );
+ FG_LOG ( FG_GENERAL, FG_INFO, general.get_glRenderer() );
#if 0
// try to determine if we should adjust the initial default
// $Log$
+// Revision 1.78 1999/01/07 20:25:08 curt
+// Updated struct fgGENERAL to class FGGeneral.
+//
// Revision 1.77 1998/12/18 23:40:55 curt
// New frame rate counting mechanism.
//
#include <string>
#include <Include/fg_constants.h>
-#include <Include/general.h>
#include <Aircraft/aircraft.hxx>
#include <Airports/simple.hxx>
#include <Astro/solarsystem.hxx>
#include <Autopilot/autopilot.hxx>
#include <Cockpit/cockpit.hxx>
-// #include <Debug/fg_debug.h>
#include <Debug/logstream.hxx>
#include <Joystick/joystick.hxx>
#include <Math/fg_geodesy.hxx>
// $Log$
+// Revision 1.60 1999/01/07 20:25:09 curt
+// Updated struct fgGENERAL to class FGGeneral.
+//
// Revision 1.59 1998/12/18 23:40:57 curt
// New frame rate counting mechanism.
//
printf("\t--units-meters: Hud displays units in meters\n");
printf("\t--hud-tris: Hud displays number of triangles rendered\n");
printf("\t--hud-culled: Hud displays percentage of triangles culled\n");
+ printf("\n");
printf("Time Options:\n");
printf("\t--time-offset=[+-]hh:mm:ss: offset local time by this amount\n");
// $Log$
+// Revision 1.36 1999/01/07 20:25:10 curt
+// Updated struct fgGENERAL to class FGGeneral.
+//
// Revision 1.35 1998/12/06 14:52:57 curt
// Fixed a problem with the initial starting altitude. "v->abs_view_pos" wasn't
// being calculated correctly at the beginning causing the first terrain
#include "views.hxx"
+// temporary (hopefully) hack
+static int panel_hist = 0;
+
+
// specify code paths ... these are done as variable rather than
// #define's because down the road we may want to choose between them
// on the fly for different flight models ... this way magic carpet
// $Log$
+// Revision 1.32 1999/01/07 20:25:12 curt
+// Updated struct fgGENERAL to class FGGeneral.
+//
// Revision 1.31 1998/12/11 20:26:28 curt
// Fixed view frustum culling accuracy bug so we can look out the sides and
// back without tri-stripes dropping out.