Changeset 10098 for OpenSceneGraph/trunk/include/osgViewer/ViewerBase
- Timestamp:
- 04/24/09 18:20:50 (4 years ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/include/osgViewer/ViewerBase (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgViewer/ViewerBase
r9917 r10098 200 200 void checkWindowStatus(); 201 201 202 202 enum FrameScheme 203 { 204 ON_DEMAND, 205 CONTINUOUS 206 }; 207 208 void setRunFrameScheme(FrameScheme fs) { _runFrameScheme = fs; } 209 FrameScheme getRunFrameScheme() const { return _runFrameScheme; } 210 211 void setRunMaxFrameRate(double frameRate) { _runMaxFrameRate = frameRate; } 212 double getRunMaxFrameRate() const { return _runMaxFrameRate; } 203 213 204 214 /** Execute a main frame loop. … … 207 217 * and installs trackball manipulator if one is not already assigned. 208 218 */ 209 virtual int run() = 0; 219 virtual int run(); 220 221 /** check to see if the new frame is required, called by run(..) when FrameScheme is set to ON_DEMAND.*/ 222 virtual bool checkNeedToDoFrame() = 0; 210 223 211 224 /** Render a complete new frame. … … 250 263 251 264 protected: 252 265 266 void viewerBaseInit(); 267 268 friend class osgViewer::View; 269 253 270 inline void makeCurrent(osg::GraphicsContext* gc) 254 271 { 255 272 if (_currentContext==gc) return; 256 273 257 274 releaseContext(); 258 275 259 276 if (gc && gc->valid() && gc->makeCurrent()) _currentContext = gc; 260 277 } 261 278 262 279 inline void releaseContext() 263 280 { … … 276 293 bool _quitEventSetsDone; 277 294 bool _releaseContextAtEndOfFrameHint; 278 295 279 296 ThreadingModel _threadingModel; 280 297 bool _threadsRunning; 298 299 bool _requestRedraw; 300 bool _requestContinousUpdate; 301 302 FrameScheme _runFrameScheme; 303 double _runMaxFrameRate; 304 281 305 282 306 BarrierPosition _endBarrierPosition; … … 285 309 osg::ref_ptr<osg::BarrierOperation> _endRenderingDispatchBarrier; 286 310 osg::ref_ptr<osg::EndOfDynamicDrawBlock> _endDynamicDrawBlock; 287 311 288 312 osg::ref_ptr<osgGA::EventVisitor> _eventVisitor; 289 313 290 314 osg::ref_ptr<osg::OperationQueue> _updateOperations; 291 315 osg::ref_ptr<osgUtil::UpdateVisitor> _updateVisitor; 292 316 293 317 osg::ref_ptr<osg::Operation> _realizeOperation; 294 318 osg::ref_ptr<osgUtil::IncrementalCompileOperation> _incrementalCompileOperation;
