globals->add_subsystem("lighting", new FGLight);
+ //////////////////////////////////////////////////////////////////////
+ // Initialize the 2D cloud subsystem.
+ ////////////////////////////////////////////////////////////////////
+ fgGetNode("/sim/rendering/bump-mapping", true);
#ifdef FG_USE_CLOUDS_3D
////////////////////////////////////////////////////////////////////
// and update the stencil buffer with 1
glEnable( GL_STENCIL_TEST );
glStencilFunc( GL_ALWAYS, 1, 1 );
- glStencilOp( GL_REPLACE, GL_REPLACE, GL_REPLACE );
+ glStencilOp( GL_KEEP, GL_KEEP, GL_REPLACE );
}
FGTileMgr::set_tile_filter( false );
sgSetModelFilter( true );
// and update the stencil buffer with 1
glEnable( GL_STENCIL_TEST );
glStencilFunc( GL_ALWAYS, 1, 1 );
- glStencilOp( GL_REPLACE, GL_REPLACE, GL_REPLACE );
+ glStencilOp( GL_KEEP, GL_KEEP, GL_REPLACE );
}
FGTileMgr::set_tile_filter( false );
sgSetModelFilter( true );
// static const SGPropertyNode *replay_master
// = fgGetNode("/sim/freeze/replay", true);
+ SGCloudLayer::enable_bump_mapping = fgGetBool("/sim/rendering/bump-mapping",true);
+
// Update the elapsed time.
static bool first_time = true;
if ( first_time ) {
// build our custom render states
fgBuildRenderStates();
-
- // pass control off to the master event handler
- fgOSMainLoop();
+
+ try {
+ // pass control off to the master event handler
+ fgOSMainLoop();
+ } catch (...) {
+ SG_LOG( SG_ALL, SG_ALERT,
+ "Unknown exception in the main loop. Aborting..." );
+ }
// we never actually get here ... but to avoid compiler warnings,
// etc.