[osg-users] OpenSceneGraph 2.19 osgViewer

#POH CHENG GUAN# timpcg at pmail.ntu.edu.sg
Wed Sep 5 21:01:06 PDT 2007


Hi Robert,
 
This is the code example that crashes:
 
_viewer->setSceneData(0);
 
if (!_viewer->isRealized())
_viewer->realize();
 
when I passed in 0, it crashes. If I pass in new osg::Node, it works.
 
Regards,
CG

________________________________

From: osg-users-bounces at lists.openscenegraph.org on behalf of Robert Osfield
Sent: Wed 9/5/2007 4:43 PM
To: Public OpenSceneGraph Users discussion list.
Subject: Re: [osg-users] OpenSceneGraph 2.19 osgViewer



Hi CG,

2.1.9 should be able handle an null scene data, 2.0 was known to crash
in this situation but I've merged and bug fix to this since 2.0.  If
you are still see this then this is a bug that needs resolving.  Could
you provide a code example that crashes.

W.r.t update, you don't need to call this explicitly, as the frame now
calls this.  Code before in 1.2 was:

   while (!viewer.done())
   {
      viewer.sync();
      viewer.update();
      viewer.frame();
   }

In 2.x you can do:

   while(!viewer.done())
   {
      viewer.frame(); // frame calls everything thing for you
   }

Or you can do it short hand by replacing the above with:

   viewer.run();

Or you can do it long hand by replacing the above with:

  while(!viewer.done())
  {
      viewer.advance();
      viewer.eventTraversal();
      viewer.updateTraversal();
      viewer.renderingTraversals();
  }

The clear up frame calls in 1.2 osgProducer::Viewer are also gone,
there aren't needn't osgViewer::Viewer does clean up by itself.  You
can also stop and start threading if you need to, something that
wasn't possible in 1.2.

Robert.

On 9/5/07, #POH CHENG GUAN# <timpcg at pmail.ntu.edu.sg> wrote:
>
>
> Hi,
>
> Is it possible to just render an empty background without loading a model?
> If I set my viewer->setSceneData(0), osgViewer crashes when it comes to
> viewer->realize().
>
> Does anyone have a porting guide from version 1.2 to 2.19? The online
> version is quite brief, in version 1.2, I will call viewer->update(), what
> is the function that replaces this call for version 2.19?
>
> Regards,
> CG
>
>
> ________________________________
>  **Disclaimer**
>  The sender of this email is NOT authorized to represent or act on behalf of
> Nanyang Technological
>  University in any matter or transaction by means of using this email
> account.
>
>  Nanyang Technological University will not be responsible for any content or
> views expressed in this
>  email and this email does not express the views or opinions of the Nanyang
> Technological University.
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 6806 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070906/df53c351/attachment-0003.bin>


More information about the osg-users mailing list