Changeset 311 for experimental/distortionNG
- Timestamp:
- Aug 3, 2011, 10:10:59 PM (13 years ago)
- Location:
- experimental/distortionNG
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/distortionNG/extViewer.cpp
r310 r311 1 1 #include "extViewer.h" 2 2 3 extViewer::extViewer( void)3 extViewer::extViewer() : Viewer() 4 4 { 5 5 6 } 6 7 7 extViewer:: ~extViewer(void)8 extViewer::extViewer(osg::ArgumentParser& arguments) : Viewer(arguments) 8 9 { 10 9 11 } 12 13 extViewer::extViewer(const osgViewer::Viewer& viewer, const osg::CopyOp& copyop) : Viewer(viewer, copyop) 14 { 15 16 } 17 18 extViewer::~extViewer() 19 { 20 21 } 22 23 void extViewer::setUpViewForDistortion() 24 { 25 OSG_INFO<<"View::setUpViewForDistortion"<<std::endl; 26 osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface(); 27 if (!wsi) 28 { 29 OSG_NOTICE<<"Error, no WindowSystemInterface available, cannot create windows."<<std::endl; 30 return; 31 } 32 33 osg::GraphicsContext::ScreenIdentifier si; 34 si.readDISPLAY(); 35 36 // displayNum has not been set so reset it to 0. 37 if (si.displayNum<0) si.displayNum = 0; 38 39 si.screenNum = screenNum; 40 41 unsigned int width, height; 42 wsi->getScreenResolution(si, width, height); 43 44 45 osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits; 46 traits->hostName = si.hostName; 47 traits->displayNum = si.displayNum; 48 traits->screenNum = si.screenNum; 49 traits->x = 0; 50 traits->y = 0; 51 traits->width = width; 52 traits->height = height; 53 traits->windowDecoration = false; 54 traits->doubleBuffer = true; 55 traits->sharedContext = 0; 56 57 58 osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get()); 59 if (!gc) 60 { 61 OSG_NOTICE<<"GraphicsWindow has not been created successfully."<<std::endl; 62 return; 63 } 64 } -
experimental/distortionNG/extViewer.h
r310 r311 3 3 4 4 class extViewer : public osgViewer::Viewer 5 6 5 { 7 6 public: 8 extViewer(void); 9 virtual ~extViewer(void); 7 extViewer(); 8 9 extViewer(osg::ArgumentParser& arguments); 10 11 extViewer(const osgViewer::Viewer& viewer, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); 12 13 virtual ~extViewer(); 14 15 /** Convenience method for projection on curved screens using a slave camera rendering scene and a second camera doing distortion correction to present on a nonplaner display.*/ 16 void setUpViewForDistortion(); 10 17 }; -
experimental/distortionNG/main.cpp
r310 r311 40 40 41 41 // construct the viewer. 42 osgViewer::Viewer viewer(arguments);42 extViewer viewer(arguments); 43 43 44 44 // set up the camera manipulators.
Note: See TracChangeset
for help on using the changeset viewer.