Changeset 9601 for OpenSceneGraph/trunk/src/osgViewer/StatsHandler.cpp
- Timestamp:
- 01/30/09 13:09:06 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgViewer/StatsHandler.cpp
r9575 r9601 276 276 _camera->setRenderOrder(osg::Camera::POST_RENDER, 10); 277 277 278 _camera->setProjectionMatrix(osg::Matrix::ortho2D(0, 1280,0,1024));278 _camera->setProjectionMatrix(osg::Matrix::ortho2D(0,window->getTraits()->width,0,window->getTraits()->height)); 279 279 _camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); 280 280 _camera->setViewMatrix(osg::Matrix::identity()); … … 609 609 { 610 610 _pos -= osg::Vec3(0, height, 0.1); 611 this->setMatrix(osg::Matrix::translate(_pos));612 this->addChild(_statsGraphGeode.get());611 setMatrix(osg::Matrix::translate(_pos)); 612 addChild(_statsGraphGeode.get()); 613 613 } 614 614 … … 630 630 const osg::Vec4& color, float max, const std::string& nameBegin, const std::string& nameEnd = "") 631 631 { 632 this->setUseDisplayList(false);633 634 this->setVertexArray(new osg::Vec3Array);632 setUseDisplayList(false); 633 634 setVertexArray(new osg::Vec3Array); 635 635 636 636 osg::Vec4Array* colors = new osg::Vec4Array; 637 637 colors->push_back(color); 638 this->setColorArray(colors);639 this->setColorBinding(osg::Geometry::BIND_OVERALL);640 641 this->setDrawCallback(new GraphUpdateCallback(width, height, viewerStats, stats, max, nameBegin, nameEnd));638 setColorArray(colors); 639 setColorBinding(osg::Geometry::BIND_OVERALL); 640 641 setDrawCallback(new GraphUpdateCallback(width, height, viewerStats, stats, max, nameBegin, nameEnd)); 642 642 } 643 643 }; … … 1094 1094 float topOfViewerStats = pos.y() + characterSize; 1095 1095 1096 geode->addDrawable(createBackgroundRectangle( pos + osg::Vec3(-backgroundMargin, characterSize + backgroundMargin, 0), 1097 _camera->getViewport()->width() - 2 * backgroundMargin, 1098 (3 + 4.5 * cameras.size()) * characterSize + 2 * backgroundMargin, 1099 backgroundColor) ); 1096 geode->addDrawable(createBackgroundRectangle( 1097 pos + osg::Vec3(-backgroundMargin, characterSize + backgroundMargin, 0), 1098 _camera->getViewport()->width() - 2 * backgroundMargin, 1099 (3 + 4.5 * cameras.size()) * characterSize + 2 * backgroundMargin, 1100 backgroundColor) ); 1100 1101 1101 1102 {
