Yes, my main concern is that inside the 
ViewerBase::renderingTraversals() function there are lots of other 
activities after the loop of swapbuffers calls. If I separate 
swapbuffers out into a separate function, and call it later (after 
all those activities in renderingTraversals()), I'm not sure if it 
will still work out without breaking something. I guess I'll do some
testing.

Yefei


-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of J.P. Delport
Sent: Wednesday, January 20, 2010 1:01 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Separating draw and swapbuffers

Hi,

He, Yefei wrote:
> Hello, Robert,
> 
>     I noticed that when using the osgviewer, the draw and swapbuffers
> operations take place within the same function call, 
> ViewerBase::renderingTraversals(). Before, with Producer, I can call 
> Producer::Camera::frame(false) to perform draw operation without 
> swapping the buffers, and do swapbuffers later explicitly. This way 
> I can insert my own vertical sync code or some other process between 
> draw and swapbuffers. Is there already something similar provided for 
> doing this with osgviewer? The only sample code that calls swapbuffers
> explicitly is osgSlice but that program doesn't use osgviewer, rather
> it creates sceneView and graphicsContext directly. I'm hesitant to 
> break up ViewerBase::renderingTraversals() on my own since there are 
> thread sync related code around the loop that calls 
> GraphicsContext::runOperations() and the loop that calls 
> GraphicsContext::swapBuffers(), and I'm worried about any implications
> of interrupting it.

I'm not sure, but doesn't swapBuffers just call some other windowing 
implementation swapbuffersimplementation function? Maybe you can 
override that?

jp

> 
>     Thanks,
> 
>     Yefei
>     
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to