[Gcblue-commits] gcb_wx/src/graphics cspSky.cpp,1.6,1.7
Status: Alpha
Brought to you by:
ddcforge
From: <ddc...@us...> - 2004-02-12 01:59:23
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26928/src/graphics Modified Files: cspSky.cpp Log Message: Index: cspSky.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/cspSky.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** cspSky.cpp 20 Jan 2004 03:02:53 -0000 1.6 --- cspSky.cpp 12 Feb 2004 01:54:49 -0000 1.7 *************** *** 212,221 **** Vec4Array::const_iterator c = _colorList->begin(); ! glPushAttrib(GL_ENABLE_BIT); glPushMatrix(); glRotatef(rx, 1, 0, 0); glRotatef(rz, 0, 0, 1); glBegin(GL_POINTS); ! glEnable(GL_BLEND); for (; --i >= 0; ++c, ++p) { --- 212,221 ---- Vec4Array::const_iterator c = _colorList->begin(); ! //glPushAttrib(GL_ENABLE_BIT); glPushMatrix(); glRotatef(rx, 1, 0, 0); glRotatef(rz, 0, 0, 1); glBegin(GL_POINTS); ! //glEnable(GL_BLEND); // this line suddenly started causing OSG OpenGL errors with State::apply !? for (; --i >= 0; ++c, ++p) { *************** *** 226,230 **** glEnd(); glPopMatrix(); ! glPopAttrib(); //PROF1(_stars, 4); } --- 226,230 ---- glEnd(); glPopMatrix(); ! //glPopAttrib(); //PROF1(_stars, 4); } *************** *** 1256,1259 **** --- 1256,1269 ---- depth->setWriteMask(false); star_state->setAttributeAndModes(depth,StateAttribute::OFF); + + /* added this code instead of the glEnable(GL_BLEND) in StarSystem::drawImplementation + Though the blend never worked before, the old code suddenly starting causing OpenGL + errors in State::apply after adding the new radar code (which has NOTHING to do with + graphics). + */ + osg::BlendFunc *blendFunction = new osg::BlendFunc; + blendFunction->setFunction(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE_MINUS_SRC_ALPHA); + star_state->setAttributeAndModes(blendFunction, osg::StateAttribute::ON); + } |