Changeset 13041 for OpenSceneGraph/trunk/src/osgUtil/GLObjectsVisitor.cpp
- Timestamp:
- 03/21/12 18:36:20 (15 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgUtil/GLObjectsVisitor.cpp
r11844 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 17 17 #include <osg/Timer> 18 18 19 namespace osgUtil 19 namespace osgUtil 20 20 { 21 21 … … 67 67 { 68 68 if (_drawablesAppliedSet.count(&drawable)!=0) return; 69 69 70 70 _drawablesAppliedSet.insert(&drawable); 71 71 … … 105 105 { 106 106 if (_stateSetAppliedSet.count(&stateset)!=0) return; 107 107 108 108 _stateSetAppliedSet.insert(&stateset); 109 109 … … 111 111 { 112 112 stateset.compileGLObjects(*_renderInfo.getState()); 113 113 114 114 osg::Program* program = dynamic_cast<osg::Program*>(stateset.getAttribute(osg::StateAttribute::PROGRAM)); 115 115 if (program) { 116 116 if( program->isFixedFunction() ) 117 117 _lastCompiledProgram = NULL; // It does not make sense to apply uniforms on fixed pipe 118 else 118 else 119 119 _lastCompiledProgram = program; 120 120 } … … 126 126 { 127 127 pcp->useProgram(); 128 128 129 129 _renderInfo.getState()->setLastAppliedProgramObject(pcp); 130 130 131 131 osg::StateSet::UniformList& ul = stateset.getUniformList(); 132 132 for(osg::StateSet::UniformList::iterator itr = ul.begin(); … … 139 139 } 140 140 else if(_renderInfo.getState()->getLastAppliedProgramObject()){ 141 141 142 142 osg::GL2Extensions* extensions = osg::GL2Extensions::Get(_renderInfo.getState()->getContextID(), true); 143 143 extensions->glUseProgram(0); 144 144 _renderInfo.getState()->setLastAppliedProgramObject(0); 145 145 } 146 146 147 147 } 148 148 … … 151 151 stateset.releaseGLObjects(_renderInfo.getState()); 152 152 } 153 153 154 154 if (_mode & CHECK_BLACK_LISTED_MODES) 155 155 { … … 179 179 { 180 180 GLObjectsVisitor glObjectsVisitor(_mode); 181 181 182 182 context->getState()->initializeExtensionProcs(); 183 183 184 184 glObjectsVisitor.setState(context->getState()); 185 185 186 186 // OSG_NOTICE<<"GLObjectsOperation::before <<<<<<<<<<<"<<std::endl; 187 187 if (_subgraph.valid())
