Show
Ignore:
Timestamp:
04/19/11 14:01:38 (3 years ago)
Author:
robert
Message:

From Jan Peciva, "please find attached proposed fix for ON_DEMAND rendering. The biggest issue was
that the windows did not act on repaint request (WM_PAINT, EXPOSE,...)

Detailed explanation:
- I implemented requestRedraw using the push approach (not using
GraphicsWindow::_requestRedraw flag that I was considering) as there may be
multiple viewers reading the flag and fighting to reset it after the paint
request, while some viewers may not spot the request to redraw
- I made windows call GraphicsWindow::requestRedraw when they receive
appropriate message (WM_PAINT, EXPOSE, RESIZE,...)
- There were issues on Linux that windows did not want to close using x
button. Resolved by moving the test for DeleteWindow? event from
swapBuffersImplementation() to GraphicsWindowX11::checkEvents(). The difficulty
was that DeleteWindow? event is not coming using _eventDisplay, but through
_display.
- The last difficulty was that it is necessary to call
ViewerBase::checkWindowStatus() to set _done to true when all windows are
closed. This did not happened recently in ON_DEMAND run scheme. I put the call
to checkWindowStatus() to eventTraversal.
"

Files:
1 modified

Legend:

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

    r12293 r12294  
    196196 
    197197 
    198         /** Check to see if windows are still open, if not set viewer done to true. */ 
    199         void checkWindowStatus(); 
    200  
    201198        enum FrameScheme 
    202199        { 
     
    254251        virtual void getViews(Views& views, bool onlyValid=true) = 0; 
    255252 
     253        /** Check to see if any windows are still open. If not, set viewer done to true. */ 
     254        void checkWindowStatus(); 
     255 
     256        /** Check to see if windows are still open using the list of contexts given as a parameter. 
     257         *  If no windows are open, stop rendering threads and set viewer done to true. 
     258         *  This function is more effective than checkWindowStatus() as it does not query 
     259         *  the context list and should be used whenever context list is already available in your code.*/ 
     260        void checkWindowStatus(const Contexts& contexts); 
     261 
    256262        virtual double elapsedTime() = 0; 
    257263