Show
Ignore:
Timestamp:
10/11/09 08:05:19 (5 years ago)
Author:
robert
Message:

Made the use of the new projection and modelview matrix uniforms optional

Files:
1 modified

Legend:

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

    r10621 r10641  
    2121#include <osgDB/WriteFile> 
    2222#include <osgViewer/Viewer> 
     23#include <osgGA/TrackballManipulator> 
    2324 
    2425class ConvertToVertexAttibArrays : public osg::NodeVisitor 
     
    330331    viewer.setSceneData(loadedModel.get()); 
    331332 
     333    viewer.setCameraManipulator(new osgGA::TrackballManipulator()); 
     334 
     335    viewer.realize(); 
     336 
     337    // switch on the uniforms that track the modelview and projection matrices 
     338    osgViewer::Viewer::Windows windows; 
     339    viewer.getWindows(windows); 
     340    for(osgViewer::Viewer::Windows::iterator itr = windows.begin(); 
     341        itr != windows.end(); 
     342        ++itr) 
     343    { 
     344        (*itr)->getState()->setUseModelViewAndProjectionUniforms(true); 
     345    } 
     346 
    332347    return viewer.run(); 
    333348}