static int sgSkyDomePreDraw( ssgEntity *e ) {
/* cout << endl << "Dome Pre Draw" << endl << "----------------"
<< endl << endl; */
+
+ ssgLeaf *f = (ssgLeaf *)e;
+ if ( f -> hasState () ) f->getState()->apply() ;
+
+ glPushAttrib( GL_DEPTH_BUFFER_BIT | GL_FOG_BIT );
+ // cout << "push error = " << glGetError() << endl;
+
glDisable( GL_DEPTH_TEST );
glDisable( GL_FOG );
static int sgSkyDomePostDraw( ssgEntity *e ) {
/* cout << endl << "Dome Post Draw" << endl << "----------------"
<< endl << endl; */
- glEnable( GL_DEPTH_TEST );
- glEnable( GL_FOG );
+ glPopAttrib();
+ // cout << "pop error = " << glGetError() << endl;
+
return true;
}
static int sgMoonOrbPreDraw( ssgEntity *e ) {
/* cout << endl << "Moon orb pre draw" << endl << "----------------"
<< endl << endl; */
+
+ ssgLeaf *f = (ssgLeaf *)e;
+ if ( f -> hasState () ) f->getState()->apply() ;
+
+ glPushAttrib( GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT );
+ // cout << "push error = " << glGetError() << endl;
+
glDisable( GL_DEPTH_TEST );
glDisable( GL_FOG );
glBlendFunc ( GL_SRC_ALPHA, GL_ONE ) ;
static int sgMoonOrbPostDraw( ssgEntity *e ) {
/* cout << endl << "Moon orb post draw" << endl << "----------------"
<< endl << endl; */
- glEnable( GL_DEPTH_TEST );
- glEnable( GL_FOG );
- glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
+ // glEnable( GL_DEPTH_TEST );
+ // glEnable( GL_FOG );
+ // glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
+ glPopAttrib();
+ // cout << "pop error = " << glGetError() << endl;
+
/* test
glDisable( GL_LIGHTING );
glDisable( GL_CULL_FACE );
static int sgMoonHaloPreDraw( ssgEntity *e ) {
/* cout << endl << "Moon halo pre draw" << endl << "----------------"
<< endl << endl; */
+
+ ssgLeaf *f = (ssgLeaf *)e;
+ if ( f -> hasState () ) f->getState()->apply() ;
+
+ glPushAttrib( GL_DEPTH_BUFFER_BIT | GL_FOG_BIT | GL_COLOR_BUFFER_BIT);
+ cout << "push error = " << glGetError() << endl;
+
glDisable( GL_DEPTH_TEST );
glDisable( GL_FOG );
glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
static int sgMoonHaloPostDraw( ssgEntity *e ) {
/* cout << endl << "Moon halo post draw" << endl << "----------------"
<< endl << endl; */
- glEnable( GL_DEPTH_TEST );
- glEnable( GL_FOG );
- glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
+ // glEnable( GL_DEPTH_TEST );
+ // glEnable( GL_FOG );
+ // glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
+
+ glPopAttrib();
+ cout << "pop error = " << glGetError() << endl;
return true;
}
static int sgSunOrbPreDraw( ssgEntity *e ) {
/* cout << endl << "Sun orb pre draw" << endl << "----------------"
<< endl << endl; */
+
+ ssgLeaf *f = (ssgLeaf *)e;
+ if ( f -> hasState () ) f->getState()->apply() ;
+
+ glPushAttrib( GL_DEPTH_BUFFER_BIT | GL_FOG_BIT );
+ // cout << "push error = " << glGetError() << endl;
+
glDisable( GL_DEPTH_TEST );
glDisable( GL_FOG );
static int sgSunOrbPostDraw( ssgEntity *e ) {
/* cout << endl << "Sun orb post draw" << endl << "----------------"
<< endl << endl; */
- glEnable( GL_DEPTH_TEST );
- glEnable( GL_FOG );
+
+ glPopAttrib();
+ // cout << "pop error = " << glGetError() << endl;
+
+ // glEnable( GL_DEPTH_TEST );
+ // glEnable( GL_FOG );
return true;
}
static int sgSunHaloPreDraw( ssgEntity *e ) {
/* cout << endl << "Sun halo pre draw" << endl << "----------------"
<< endl << endl; */
+
+ ssgLeaf *f = (ssgLeaf *)e;
+ if ( f -> hasState () ) f->getState()->apply() ;
+
+ glPushAttrib( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_FOG_BIT );
+ // cout << "push error = " << glGetError() << endl;
+
glDisable( GL_DEPTH_TEST );
glDisable( GL_FOG );
glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
static int sgSunHaloPostDraw( ssgEntity *e ) {
/* cout << endl << "Sun halo post draw" << endl << "----------------"
<< endl << endl; */
- glEnable( GL_DEPTH_TEST );
- glEnable( GL_FOG );
+
+ glPopAttrib();
+ // cout << "pop error = " << glGetError() << endl;
+
+ // glEnable( GL_DEPTH_TEST );
+ // glEnable( GL_FOG );
return true;
}
static int sgStarPreDraw( ssgEntity *e ) {
/* cout << endl << "Star pre draw" << endl << "----------------"
<< endl << endl; */
+
+ ssgLeaf *f = (ssgLeaf *)e;
+ if ( f -> hasState () ) f->getState()->apply() ;
+
+ glPushAttrib( GL_DEPTH_BUFFER_BIT | GL_FOG_BIT );
+
glDisable( GL_DEPTH_TEST );
glDisable( GL_FOG );
- glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
+ // glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
return true;
}
static int sgStarPostDraw( ssgEntity *e ) {
/* cout << endl << "Star post draw" << endl << "----------------"
<< endl << endl; */
- glEnable( GL_DEPTH_TEST );
- glEnable( GL_FOG );
+
+ glPopAttrib();
+
+ // glEnable( GL_DEPTH_TEST );
+ // glEnable( GL_FOG );
return true;
}