Show
Ignore:
Timestamp:
06/04/08 18:46:14 (7 years ago)
Author:
robert
Message:

Added support for optionally calling releaseContext at the end of each
renderinTraversals() to help with cases where uses are driving multiple
contexts from mulitple viewers in a single threaded frame loop.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osgViewer/ViewerBase

    r7648 r8406  
    141141 
    142142 
     143        /** Hint to tell the renderingTraversals() method whether to call relaseContext() on the last 
     144          * context that was made current by the thread calling renderingTraverals().  Note, when  
     145          * running multi-threaded viewer no threads will be made current or release current. 
     146          * Setting this hint to false can enable the frame loop to be lazy about calling makeCurrent 
     147          * and releaseContext on each new frame, helping performance.  However, if you frame loop 
     148          * is managing multiple graphics context all from the main frame thread then this hint must 
     149          * be left on, otherwise the wrong context could be left active, introducing errors in rendering.*/ 
     150        void setReleaseContextAtEndOfFrameHint(bool hint) { _releaseContextAtEndOfFrameHint = hint; } 
     151         
     152        /** Hint to tell the renderingTraversals() method whether to call relaseContext().*/ 
     153        bool getReleaseContextAtEndOfFrameHint() const { return _releaseContextAtEndOfFrameHint; } 
     154 
    143155 
    144156        /** Set the UpdateVisitor. */ 
     
    226238        /** Get the keyboard and mouse usage of this viewer.*/ 
    227239        virtual void getUsage(osg::ApplicationUsage& usage) const = 0; 
    228  
     240         
    229241    protected: 
    230242     
     
    256268        int                                         _keyEventSetsDone; 
    257269        bool                                        _quitEventSetsDone; 
     270        bool                                        _releaseContextAtEndOfFrameHint; 
    258271         
    259272        ThreadingModel                              _threadingModel;