~ubuntu-branches/debian/experimental/openscenegraph/experimental

« back to all changes in this revision

Viewing changes to OpenSceneGraph/examples/osghud/osghud.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alberto Luaces
  • Date: 2011-01-29 11:36:29 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20110129113629-qisrm2kdqlurc7t3
Tags: 2.9.11-1
* Removed bug-555869-ftbfs_with_binutils_gold.dpatch since upstream has
  already taken care of the issue.
* Removed bug-528229.dpatch since the pkgconfig files are now also split
  in upstream.
* Removed explicit dependency on GLU.
* Upstream no longer includes osgIntrospection (Closes: #592420).
* Disabled zip plugin as its implementation stores an embedded copy of
  zlib.
* Enabled Qt support. Thanks James Goppert.
* Enabled SVG and PDF plugins. Thanks James Goppert.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
osg::Camera* createHUD()
42
42
{
43
 
    // create a camera to set up the projection and model view matrices, and the subgraph to drawn in the HUD
 
43
    // create a camera to set up the projection and model view matrices, and the subgraph to draw in the HUD
44
44
    osg::Camera* camera = new osg::Camera;
45
45
 
46
46
    // set the projection matrix
68
68
 
69
69
        std::string timesFont("fonts/arial.ttf");
70
70
 
71
 
        // turn lighting off for the text and disable depth test to ensure its always ontop.
 
71
        // turn lighting off for the text and disable depth test to ensure it's always ontop.
72
72
        osg::StateSet* stateset = geode->getOrCreateStateSet();
73
73
        stateset->setMode(GL_LIGHTING,osg::StateAttribute::OFF);
74
74
 
141
141
            text->setFont(timesFont);
142
142
            text->setPosition(position);
143
143
            text->setText("And finally set the Camera's RenderOrder to POST_RENDER\n"
144
 
                          "to make sure its drawn last.");
 
144
                          "to make sure it's drawn last.");
145
145
 
146
146
            position += delta;
147
147
        }    
274
274
    // read the scene from the list of file specified commandline args.
275
275
    osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments);
276
276
    
277
 
    // if not loaded assume no arguments passed in, try use default mode instead.
 
277
    // if not loaded assume no arguments passed in, try use default model instead.
278
278
    if (!scene) scene = osgDB::readNodeFile("dumptruck.osg");
279
279
    
280
280
    
301
301
        
302
302
        osg::Camera* hudCamera = createHUD();
303
303
        
304
 
        // set up cameras to rendering on the first window available.
 
304
        // set up cameras to render on the first window available.
305
305
        hudCamera->setGraphicsContext(windows[0]);
306
306
        hudCamera->setViewport(0,0,windows[0]->getTraits()->width, windows[0]->getTraits()->height);
307
307
 
335
335
        
336
336
        osg::Camera* hudCamera = createHUD();
337
337
        
338
 
        // set up cameras to rendering on the first window available.
 
338
        // set up cameras to render on the first window available.
339
339
        hudCamera->setGraphicsContext(windows[0]);
340
340
        hudCamera->setViewport(0,0,windows[0]->getTraits()->width, windows[0]->getTraits()->height);
341
341