Converted fog to GL_FOG_EXP2.
Link to static simulator parts.
Update runfg.bat to try to be a little smarter.
#include <Aircraft/aircraft.h>
#include <Autopilot/autopilot.h> // Added autopilot.h to list, Jeff Goeke-Smith
#include <Debug/fg_debug.h>
+#include <Gui/gui.h>
#include <Include/fg_constants.h>
+#include <Pui/pu.h>
#include <Weather/weather.h>
#include "GLUTkey.hxx"
fgTIME *t;
fgVIEW *v;
struct fgWEATHER *w;
+ float tmp;
c = current_aircraft.controls;
o = ¤t_options;
w = ¤t_weather;
fgPrintf( FG_INPUT, FG_DEBUG, "Key hit = %d", k);
+ puKeyboard(k, PU_DOWN );
if ( GLUT_ACTIVE_ALT && glutGetModifiers() ) {
fgPrintf( FG_INPUT, FG_DEBUG, " SHIFTED\n");
v->update_fov = TRUE;
return;
case 90: /* Z key */
- w->visibility /= 1.10;
- xglFogf (GL_FOG_START, w->visibility / 1000000.0 );
- xglFogf(GL_FOG_END, w->visibility);
- fgPrintf( FG_INPUT, FG_DEBUG,
- "Fog density = %.4f\n", w->visibility );
+ tmp = fgWeatherGetVisibility(); /* in meters */
+ tmp /= 1.10;
+ fgWeatherSetVisibility( tmp );
return;
// autopilot additions
case 65: /* A key */
v->update_fov = TRUE;
return;
case 122: /* z key */
- w->visibility *= 1.10;
- xglFogf (GL_FOG_START, w->visibility / 1000000.0 );
- xglFogf(GL_FOG_END, w->visibility);
- fgPrintf( FG_INPUT, FG_DEBUG,
- "Fog density = %.4f\n", w->visibility);
+ tmp = fgWeatherGetVisibility(); /* in meters */
+ tmp *= 1.10;
+ fgWeatherSetVisibility( tmp );
return;
case 27: /* ESC */
// if( fg_DebugOutput ) {
v = ¤t_view;
fgPrintf( FG_INPUT, FG_DEBUG, "Special key hit = %d", k);
+ puKeyboard(k + PU_KEY_GLUT_SPECIAL_OFFSET, PU_DOWN);
if ( GLUT_ACTIVE_SHIFT && glutGetModifiers() ) {
fgPrintf( FG_INPUT, FG_DEBUG, " SHIFTED\n");
} else {
fgPrintf( FG_INPUT, FG_DEBUG, "\n");
switch (k) {
+ case GLUT_KEY_F10: /* F10 toggles menu on and off... */
+ printf("Invoking call back function");
+ hideMenuButton ->
+ setValue ((int) !(hideMenuButton -> getValue() ) );
+ hideMenuButton -> invokeCallback();
+ //exit(1);
+ return;
case GLUT_KEY_UP:
fgElevMove(0.05);
return;
/* $Log$
-/* Revision 1.10 1998/05/27 02:24:05 curt
-/* View optimizations by Norman Vine.
+/* Revision 1.11 1998/06/12 00:57:38 curt
+/* Added support for Pui/Gui.
+/* Converted fog to GL_FOG_EXP2.
+/* Link to static simulator parts.
+/* Update runfg.bat to try to be a little smarter.
/*
+ * Revision 1.10 1998/05/27 02:24:05 curt
+ * View optimizations by Norman Vine.
+ *
* Revision 1.9 1998/05/16 13:05:21 curt
* Added limits to fov.
*
#include <Cockpit/cockpit.hxx>
#include <Debug/fg_debug.h>
+#include <Gui/gui.h>
#include <Joystick/joystick.h>
#include <Math/fg_geodesy.h>
#include <Math/mat3.h>
#include <Math/polar3d.h>
+#include <Pui/pu.h>
#include <Scenery/scenery.hxx>
#include <Scenery/tilemgr.hxx>
#include <Time/event.hxx>
xglEnable( GL_LIGHT0 );
xglLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec );
- xglFogi (GL_FOG_MODE, GL_LINEAR);
- xglFogf (GL_FOG_START, w->visibility / 1000000.0 );
- xglFogf (GL_FOG_END, w->visibility);
- // xglFogf (GL_FOG_DENSITY, w->visibility);
+ // xglFogi (GL_FOG_MODE, GL_LINEAR);
+ xglFogi (GL_FOG_MODE, GL_EXP);
+ // Fog density is now set when the weather system is initialized
+ // xglFogf (GL_FOG_DENSITY, w->fog_density);
if ( o->shading ) {
xglHint (GL_FOG_HINT, GL_NICEST );
} else {
t = &cur_time_params;
v = ¤t_view;
+ // this is just a temporary hack, to make me understand Pui
+ timerText -> setLabel (ctime (&t->cur_time));
+ // end of hack
+
// update view volume parameters
fgUpdateViewParams();
if (displayInstruments) {
fgUpdateInstrViewParams();
}
-
+ puDisplay();
xglutSwapBuffers();
}
xglutKeyboardFunc( GLUTkey );
glutSpecialFunc( GLUTspecialkey );
+ // call guiMouseFunc() whenever our little rodent is used
+ glutMouseFunc ( guiMouseFunc );
+ glutMotionFunc (guiMotionFunc );
+ glutPassiveMotionFunc (guiMotionFunc );
+
// call fgMainLoop() whenever there is
// nothing else to do
xglutIdleFunc( fgMainLoop );
"GLUT event handler initialization failed ...\n" );
}
+ //Init the user interface
+ guiInit();
+
// Initialize audio support
#ifdef HAVE_OSS_AUDIO
audio_mixer . setMasterVolume ( 30 ) ; /* 50% of max volume. */
// $Log$
+// Revision 1.24 1998/06/12 00:57:39 curt
+// Added support for Pui/Gui.
+// Converted fog to GL_FOG_EXP2.
+// Link to static simulator parts.
+// Update runfg.bat to try to be a little smarter.
+//
// Revision 1.23 1998/06/08 17:57:04 curt
// Minor sound/startup position tweaks.
//
views.cxx views.hxx
fg_LDADD = \
- $(top_builddir)/Simulator/Aircraft/libAircraft.la \
- $(top_builddir)/Simulator/Astro/libAstro.la \
- $(top_builddir)/Simulator/Autopilot/libAutopilot.la \
- $(top_builddir)/Simulator/Cockpit/libCockpit.la \
- $(top_builddir)/Simulator/Controls/libControls.la \
- $(top_builddir)/Simulator/Flight/libFlight.la \
- $(top_builddir)/Simulator/Flight/LaRCsim/libLaRCsim.la \
- $(top_builddir)/Simulator/Flight/Slew/libSlew.la \
- $(top_builddir)/Simulator/Scenery/libScenery.la \
- $(top_builddir)/Simulator/Time/libTime.la \
- $(top_builddir)/Simulator/Weather/libWeather.la \
- $(top_builddir)/Simulator/Joystick/libJoystick.la \
+ $(top_builddir)/Simulator/Aircraft/libAircraft.a \
+ $(top_builddir)/Simulator/Astro/libAstro.a \
+ $(top_builddir)/Simulator/Autopilot/libAutopilot.a \
+ $(top_builddir)/Simulator/Cockpit/libCockpit.a \
+ $(top_builddir)/Simulator/Controls/libControls.a \
+ $(top_builddir)/Simulator/Flight/libFlight.a \
+ $(top_builddir)/Simulator/Flight/LaRCsim/libLaRCsim.a \
+ $(top_builddir)/Simulator/Flight/Slew/libSlew.a \
+ $(top_builddir)/Simulator/Gui/libGui.a \
+ $(top_builddir)/Simulator/Scenery/libScenery.a \
+ $(top_builddir)/Simulator/Time/libTime.a \
+ $(top_builddir)/Simulator/Weather/libWeather.a \
+ $(top_builddir)/Simulator/Joystick/libJoystick.a \
$(AUDIO_LIBS) \
$(top_builddir)/Lib/Math/libMath.la \
$(top_builddir)/Lib/Bucket/libBucket.la \
$(top_builddir)/Lib/Debug/libDebug.la \
+ $(top_builddir)/Lib/Pui/libPui.la \
$(top_builddir)/Lib/zlib/libz.la
INCLUDES += \
REM @ECHO OFF\r
\r
-REM Skip ahead to CONT1 if FG_ROOT has a value\r
-IF NOT %FG_ROOT%.==. GOTO CONT1\r
+REM Skip ahead to RUN1 if %FG_ROOT%\BIN\FG.EXE exists\r
+IF EXIST %FG_ROOT%\BIN\FG.EXE GOTO RUN1\r
\r
+REM %FG_ROOT% wasn't set right so let's try "."\r
SET FG_ROOT=.\r
+IF EXIST %FG_ROOT%\BIN\FG.EXE GOTO RUN1\r
\r
-:CONT1\r
+REM %FG_ROOT% wasn't set right so let's try ".."\r
+SET FG_ROOT=..\r
+IF EXIST %FG_ROOT%\BIN\FG.EXE GOTO RUN1\r
\r
-REM Check for the existance of the executable\r
-IF NOT EXIST %FG_ROOT%\BIN\FG.EXE GOTO ERROR1\r
+REM %FG_ROOT% wasn't set right so let's try "@prefix@"\r
+SET FG_ROOT=@prefix@\r
+IF EXIST %FG_ROOT%\BIN\FG.EXE GOTO RUN1\r
\r
+ECHO Cannot find %FG_ROOT%\BIN\FG.EXE\r
+GOTO END\r
+\r
+:RUN1\r
REM Now that FG_ROOT has been set, run the program\r
ECHO FG_ROOT = %FG_ROOT%\r
%FG_ROOT%\BIN\FG.EXE %1 %2 %3 %4 %5 %6 %7 %8 %9\r
\r
GOTO END\r
\r
-:ERROR1\r
-ECHO Cannot find %FG_ROOT%\BIN\FG.EXE\r
-GOTO END\r
-\r
:END\r