#include <Scenery/scenery.hxx>
#include <Scenery/tilemgr.hxx>
#include <Sky/skydome.hxx>
+#include <Sky/skymoon.hxx>
#include <Sky/skysun.hxx>
#include <Time/event.hxx>
#include <Time/fg_time.hxx>
FGEphemeris ephem;
FGSkyDome current_sky;
FGSkySun current_sun;
+FGSkyMoon current_moon;
// hack
sgMat4 copy_of_ssgOpenGLAxisSwapMatrix =
// draw the sun
glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
- xglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ) ;
current_sun.repaint( cur_light_params.sun_angle );
sgVec3 view_pos;
sgSetVec3( view_pos,
ephem.getSunDeclination() );
current_sun.draw();
+ // draw the moon
+ glBlendFunc ( GL_SRC_ALPHA, GL_ONE ) ;
+ current_moon.repaint( cur_light_params.moon_angle );
+ sgSetVec3( view_pos,
+ current_view.get_view_pos().x(),
+ current_view.get_view_pos().y(),
+ current_view.get_view_pos().z() );
+ current_moon.reposition( view_pos,
+ t->getGst() * 15.041085,
+ ephem.getMoonRightAscension(),
+ ephem.getMoonDeclination() );
+ current_moon.draw();
+
// xglDisable( GL_FOG );
/*
_control87(MCW_EM, MCW_EM); /* defined in float.h */
#endif
+ // Initialize ssg (from plib). Needs to come before we do any
+ // other ssg related stuff
+ ssgInit();
+
// set default log levels
fglog().setLogLevels( FG_ALL, FG_INFO );
exit(-1);
}
- // Initialize ssg (from plib)
- ssgInit();
-
// Initialize the user interface (we need to do this before
// passing off control to glut and before fgInitGeneral to get our
// fonts !!!
scene->addKid( terrain );
// Initialize the sky
+ FGPath sky_tex_path( current_options.get_fg_root() );
+ sky_tex_path.append( "Textures" );
+ sky_tex_path.append( "Sky" );
current_sky.initialize();
- current_sun.initialize();
+ current_sun.initialize( sky_tex_path );
+ current_moon.initialize( sky_tex_path );
// temporary visible aircraft "own ship"
penguin_sel = new ssgSelector;