Show
Ignore:
Timestamp:
07/20/05 17:55:07 (9 years ago)
Author:
robert
Message:

Added new osg::GraphicsContext? base class

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgtext/osgtext.cpp

    r4391 r4400  
    2121 
    2222#include <osg/Geode> 
    23 #include <osg/Projection> 
    24 #include <osg/MatrixTransform> 
     23#include <osg/CameraNode> 
    2524#include <osg/ShapeDrawable> 
    2625#include <osg/Sequence> 
     
    503502        { 
    504503            // create the hud. 
    505             osg::Projection* projection = new osg::Projection; 
    506             projection->setMatrix(osg::Matrix::ortho2D(0,1280,0,1024)); 
    507  
    508             osg::MatrixTransform* modelview_abs = new osg::MatrixTransform; 
    509             modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE_RF); 
    510             modelview_abs->setMatrix(osg::Matrix::identity()); 
    511  
    512             modelview_abs->addChild(createHUDText()); 
    513  
    514             projection->addChild(modelview_abs); 
    515  
    516             group->addChild(projection); 
     504            osg::CameraNode* camera = new osg::CameraNode; 
     505            camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); 
     506            camera->setProjectionMatrixAsOrtho2D(0,1280,0,1024); 
     507            camera->setViewMatrix(osg::Matrix::identity()); 
     508            camera->setClearMask(GL_DEPTH_BUFFER_BIT); 
     509            camera->addChild(createHUDText()); 
     510            camera->getOrCreateStateSet()->setMode(GL_LIGHTING,osg::StateAttribute::OFF); 
     511 
     512            group->addChild(camera); 
    517513        } 
    518514