Re: [osg-users] Stop back buffer swap during rendering traversals

2010-07-16 Thread Robert Osfield
Hi Michael,

On Thu, Jul 15, 2010 at 2:53 PM, Michael Irby II mi...@wms.com wrote:
 Does anyone know how I could go about stopping the View from doing a back 
 buffer swap during the rendering traversals. I am outfitting OSG into current 
 rendering engine, but I need the OSG view to not swap the back buffer at the 
 end of the rendering traversals. Is there something I need to override or 
 derive from one of the view classes? Any suggestions would be appreciated.

I know nothing at all about your app or how you do windows, but
typically if users are grafting the OSG into an existing application
you'd use the osgViewer::GraphicsWindowEmbedded class to trick the
Viewer into not doing any graphics context operations, so allow it to
work with API's like GLUT and SDL, or other single windows apps.  See
the osgviewerSDL and osgviewerGLUT examples.

Robert
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Stop back buffer swap during rendering traversals

2010-07-16 Thread Michael Irby II
Hi Robert,

We have a custom 2d and 3d rendering path, we are in the process of replacing 
the 3d path with OSG. I took a look at the GraphicsWindowEmbedded. We still 
want to have OSG handle 99% of the graphics context work, but just needed a way 
to stop the back buffer swap at the end of the renderingTraversals.

I was able to implement the recommendation from Jean-Sébastien and it worked 
out great. Would there be any issues with using that solution?

Thanks,
Michael Irby

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=30083#30083





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Stop back buffer swap during rendering traversals

2010-07-15 Thread Michael Irby II
Hi,

Does anyone know how I could go about stopping the View from doing a back 
buffer swap during the rendering traversals. I am outfitting OSG into current 
rendering engine, but I need the OSG view to not swap the back buffer at the 
end of the rendering traversals. Is there something I need to override or 
derive from one of the view classes? Any suggestions would be appreciated. 

Thank you!

Cheers,
Michael

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=30032#30032





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Stop back buffer swap during rendering traversals

2010-07-15 Thread Jean-Sébastien Guay

Hi Michael,


Does anyone know how I could go about stopping the View from doing a back 
buffer swap during the rendering traversals. I am outfitting OSG into current 
rendering engine, but I need the OSG view to not swap the back buffer at the 
end of the rendering traversals. Is there something I need to override or 
derive from one of the view classes? Any suggestions would be appreciated.


Whenever I needed to do something special when the buffers are swapped 
(in your case it would be just not do it) I subclassed the 
GraphicsWindowWin32 class and overrode the swapBuffersImplementation() 
method to do whatever I wanted before calling the base class version. In 
your case you just wouldn't.


Unfortunately if your app is cross-platform you need to subclass a few 
different classes and do the same thing in each one, but it's pretty easy.


Then you just explicitly create that type of GraphicsWindow instead of 
calling osg::GraphicsContext::create() when creating your context.


Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Stop back buffer swap during rendering traversals

2010-07-15 Thread Michael Irby II
Hi,

Ah, sounds easy enough. I noticed if you call setupViewInWindow or 
setupViewOnSingleScreen the graphics context is created there. So would I just 
not call that method and then just do the graphics context, camera, and window 
setup manually?

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=30035#30035





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Stop back buffer swap during rendering traversals

2010-07-15 Thread Jean-Sébastien Guay

Hi Michael,


Ah, sounds easy enough. I noticed if you call setupViewInWindow or 
setupViewOnSingleScreen the graphics context is created there. So would I just 
not call that method and then just do the graphics context, camera, and window 
setup manually?


Yes, exactly. You can take inspiration from (i.e. lift) that code of 
course :-)


J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Stop back buffer swap during rendering traversals

2010-07-15 Thread Michael Irby II
Hi,

Excellent. Thanks for your swift response and help.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=30038#30038





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org