]> git.mxchange.org Git - flightgear.git/blobdiff - Scenery/astro.c
Add xgl wrappers for debugging.
[flightgear.git] / Scenery / astro.c
index bf5cd5e389d03bde4abfc5f3533847565332969a..411fd6b1493aef8aa57557446476c9a48e0693a5 100644 (file)
@@ -29,6 +29,7 @@
 #include <time.h>
 
 #include <GL/glut.h>
+#include "../XGL/xgl.h"
 
 #include "astro.h"
 #include "moon.h"
@@ -37,8 +38,8 @@
 #include "stars.h"
 #include "sun.h"
 
-#include "../constants.h"
-#include "../general.h"
+#include "../Include/constants.h"
+#include "../Include/general.h"
 
 #include "../Main/views.h"
 #include "../Aircraft/aircraft.h"
@@ -55,14 +56,14 @@ void fgAstroInit() {
     /* Initialize the orbital elements of sun, moon and mayor planets */
     fgSolarSystemInit(*t);
 
-    /* Intialize the moon's position */
-    fgMoonInit(); 
+    /* Initialize the Stars subsystem  */
+    fgStarsInit();             
 
     /* Initialize the sun's position */
     fgSunInit();       
 
-    /* Initialize the Stars subsystem  */
-    fgStarsInit();             
+    /* Intialize the moon's position */
+    fgMoonInit(); 
 }
 
 
@@ -87,43 +88,53 @@ void fgAstroRender() {
     }
 
     /* Disable fog effects */
-    glDisable( GL_FOG );
+    xglDisable( GL_FOG );
 
     /* set the sun position */
-    /* glLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec_inv );*/
+    xglLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec_inv );
 
-    glPushMatrix();
+    xglPushMatrix();
 
     /* Translate to view position */
-    glTranslatef( v->view_pos.x, v->view_pos.y, v->view_pos.z );
+    xglTranslatef( v->view_pos.x, v->view_pos.y, v->view_pos.z );
 
     /* Rotate based on gst (side real time) */
     angle = t->gst * 15.041085; /* should be 15.041085, Curt thought it was 15*/
 #ifdef DEBUG
     printf("Rotating astro objects by %.2f degrees\n",angle);
 #endif
-    glRotatef( angle, 0.0, 0.0, -1.0 );
-
-    /* render the stars */
-    fgStarsRender();
+    xglRotatef( angle, 0.0, 0.0, -1.0 );
 
     /* render the moon */
     fgMoonRender();
 
+    /* render the stars */
+    fgStarsRender();
+
     /* render the sun */
     fgSunRender();
 
-    glPopMatrix();
+    xglPopMatrix();
 
     /* reenable fog effects */
-    glEnable( GL_FOG );
+    xglEnable( GL_FOG );
 }
 
 
 /* $Log$
-/* Revision 1.5  1997/12/12 19:52:54  curt
-/* Working on lightling and material properties.
+/* Revision 1.8  1997/12/15 23:54:57  curt
+/* Add xgl wrappers for debugging.
+/* Generate terrain normals on the fly.
 /*
+ * Revision 1.7  1997/12/15 20:59:09  curt
+ * Misc. tweaks.
+ *
+ * Revision 1.6  1997/12/12 21:41:27  curt
+ * More light/material property tweaking ... still a ways off.
+ *
+ * Revision 1.5  1997/12/12 19:52:54  curt
+ * Working on lightling and material properties.
+ *
  * Revision 1.4  1997/12/11 04:43:56  curt
  * Fixed sun vector and lighting problems.  I thing the moon is now lit
  * correctly.