]> git.mxchange.org Git - flightgear.git/blobdiff - Main/GLUTmain.c
Tweaks to Gnu automake/autoconf system.
[flightgear.git] / Main / GLUTmain.c
index f752658f845abe712b5f20ea877eeb3c3afc1f40..0dd996cdefaacadf8dc76f14f9218a8a80389904 100644 (file)
@@ -24,7 +24,9 @@
  **************************************************************************/
 
 
-#ifdef WIN32
+#include <config.h>
+
+#ifdef HAVE_WINDOWS_H
 #  include <windows.h>                     
 #endif
 
 #include <XGL/xgl.h>
 #include <stdio.h>
 
-#ifdef __sparc__
+#ifdef HAVE_STDLIB_H
 #   include <stdlib.h>
-#else
+#endif
+#ifdef HAVE_GETOPT_H
 #   include <getopt.h>
 #endif
 
@@ -45,7 +48,7 @@
 #include <Main/views.h>
 
 #include <Include/cmdargs.h>       // Line to command line arguments
-#include <Include/fg_constants.h>
+#include <Include/fg_constants.h>  // for VERSION
 #include <Include/general.h>
 
 #include <Aircraft/aircraft.h>
@@ -69,7 +72,7 @@
 
 
 /* This is a record containing global housekeeping information */
-struct fgGENERAL general;
+fgGENERAL general;
 
 /* view parameters */
 static GLfloat win_ratio = 1.0;
@@ -212,7 +215,7 @@ static void fgInitVisuals( void ) {
     xglLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec );
 
     xglFogi (GL_FOG_MODE, GL_LINEAR);
-    /* xglFogf (GL_FOG_START, 1.0); */
+    xglFogf (GL_FOG_START, 10.0);
     xglFogf (GL_FOG_END, w->visibility);
     /* xglFogf (GL_FOG_DENSITY, w->visibility); */
     xglHint (GL_FOG_HINT, GL_NICEST /* GL_FASTEST */ );
@@ -245,7 +248,7 @@ static void fgUpdateViewParams( void ) {
        /* Tell GL we are about to modify the projection parameters */
        xglMatrixMode(GL_PROJECTION);
        xglLoadIdentity();
-       gluPerspective(55.0, 2.0/win_ratio, 1.0, 100000.0);
+       gluPerspective(45.0, 2.0/win_ratio, 1.0, 100000.0);
       }
     else
       {
@@ -253,7 +256,7 @@ static void fgUpdateViewParams( void ) {
        /* Tell GL we are about to modify the projection parameters */    
        xglMatrixMode(GL_PROJECTION);
        xglLoadIdentity();
-       gluPerspective(55.0, 1.0/win_ratio, 1.0, 100000.0);
+       gluPerspective(45.0, 1.0/win_ratio, 10.0, 100000.0);
       }
 
     xglMatrixMode(GL_MODELVIEW);
@@ -266,6 +269,13 @@ static void fgUpdateViewParams( void ) {
               v->view_pos.z + v->view_forward[2],
               v->view_up[0], v->view_up[1], v->view_up[2]);
 
+    /* look almost straight up (testing and eclipse watching) */
+    /* gluLookAt(v->view_pos.x, v->view_pos.y, v->view_pos.z,
+              v->view_pos.x + v->view_up[0] + .001, 
+              v->view_pos.y + v->view_up[1] + .001, 
+              v->view_pos.z + v->view_up[2] + .001,
+              v->view_up[0], v->view_up[1], v->view_up[2]); */
+
     /* lock view horizontally towards sun (testing) */
     /* gluLookAt(v->view_pos.x, v->view_pos.y, v->view_pos.z,
               v->view_pos.x + v->surface_to_sun[0], 
@@ -397,8 +407,19 @@ static void fgRenderFrame( void ) {
     /* set lighting parameters */
     xglLightfv(GL_LIGHT0, GL_AMBIENT, l->scene_ambient );
     xglLightfv(GL_LIGHT0, GL_DIFFUSE, l->scene_diffuse );
+    /* texture parameters */
+    xglEnable( GL_TEXTURE_2D ); /* xglDisable( GL_TEXTURE_2D ); */
+    xglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ) ;
+    xglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ) ;
+    xglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ) ;
+    xglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, 
+                     GL_LINEAR /* GL_LINEAR_MIPMAP_LINEAR */ ) ;
+    xglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ) ;
+    xglHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ) ;
+
     fgTileMgrRender();
-    /* fgSceneryRender(); */
+
+    xglDisable( GL_TEXTURE_2D );
 
     /* display HUD */
     if( show_hud ) {
@@ -469,9 +490,9 @@ void fgUpdateTimeDepCalcs(int multi_loop) {
 void fgInitTimeDepCalcs( void ) {
     /* initialize timer */
 
-#ifdef USE_ITIMER
+#ifdef HAVE_SETITIMER
     fgTimerInit( 1.0 / DEFAULT_TIMER_HZ, fgUpdateTimeDepCalcs );
-#endif USE_ITIMER
+#endif HAVE_SETITIMER
 
 }
 
@@ -682,9 +703,6 @@ int main( int argc, char *argv[] ) {
     f = current_aircraft.flight;
     //  First things first... We must have startup options dealt with.
 
-    #ifndef VERSION
-    #define VERSION "src-32A"
-    #endif
     printf("Flight Gear:  Version %s\n\n", VERSION);
 
      /*********************************************************************
@@ -793,9 +811,27 @@ extern "C" {
 #endif
 
 /* $Log$
-/* Revision 1.63  1998/02/16 16:17:39  curt
-/* Minor tweaks.
+/* Revision 1.69  1998/04/08 23:35:34  curt
+/* Tweaks to Gnu automake/autoconf system.
 /*
+ * Revision 1.68  1998/04/03 22:09:03  curt
+ * Converting to Gnu autoconf system.
+ *
+ * Revision 1.67  1998/03/23 21:24:37  curt
+ * Source code formating tweaks.
+ *
+ * Revision 1.66  1998/03/14 00:31:20  curt
+ * Beginning initial terrain texturing experiments.
+ *
+ * Revision 1.65  1998/03/09 22:45:57  curt
+ * Minor tweaks for building on sparc platform.
+ *
+ * Revision 1.64  1998/02/20 00:16:23  curt
+ * Thursday's tweaks.
+ *
+ * Revision 1.63  1998/02/16 16:17:39  curt
+ * Minor tweaks.
+ *
  * Revision 1.62  1998/02/16 13:39:42  curt
  * Miscellaneous weekend tweaks.  Fixed? a cache problem that caused whole
  * tiles to occasionally be missing.