Re: [osg-users] Slave views

2008-11-19 Thread Alberto Luaces
Hi Robert,

El Miércoles 19 Noviembre 2008ES 17:51:44 Robert Osfield escribió:
> Hi Alberto,
>
> On Wed, Nov 19, 2008 at 2:42 PM, Alberto Luaces <[EMAIL PROTECTED]> wrote:
> > Well, at least this crash was triggered by the new StatsHandler not
> > standing with a null SceneData pointer. When applying some scene, the
> > crash disappears.
>
> This is clearly a bug.  Which version of the OSG are you using?

I'm using the SVN from two days ago. This program reproduces the problem (it 
crashes after the fourth 's' pulsation):

#include 
#include 

int main()
{
  osgViewer::Viewer v;
  v.addEventHandler(new osgViewer::StatsHandler());
  v.run();

  return 0;
}

Regards,

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


Re: [osg-users] Slave views

2008-11-19 Thread Robert Osfield
Hi Alberto,

On Wed, Nov 19, 2008 at 2:42 PM, Alberto Luaces <[EMAIL PROTECTED]> wrote:
> Well, at least this crash was triggered by the new StatsHandler not standing
> with a null SceneData pointer. When applying some scene, the crash
> disappears.

This is clearly a bug.  Which version of the OSG are you using?

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


Re: [osg-users] Slave views

2008-11-19 Thread Alberto Luaces
Hi,

El Miércoles 19 Noviembre 2008ES 14:08:14 Robert Osfield escribió:
> HI Alberto,
>
> You would be best to put the viewer.realize() till after all the camera
> setup.
>
> Robert.

Putting viewer.realize() just before viewer.run() makes the slave views not 
showing on 2.4 nor SVN. I have to return to StatsHandler and osgWidget code 
to see why my code is behaving different...

Regards,

Alberto


> On Wed, Nov 19, 2008 at 12:33 PM, Alberto Luaces <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I'm having some trouble trying to set some slave cameras, acting as HUDs.
> > I have written a small program showing how I'm setting the graph. When
> > running with 2.4.0, none of the slave views are shown. When compiling
> > against SVN, the two are shown, but a crash happens when pressing 's'
> > several times, so I have to be doing something wrong to get such
> > different behaviours with several versions of the library. Currently
> > osgWidget is not an option for me as I'm tied to 2.4.0 for this project.
> > Here is the tiny code:
> >
> > #include 
> > #include 
> > #include 
> >
> > void prepareCamera(osg::Camera *c, osgViewer::Viewer &v)
> > {
> >  c->setGraphicsContext(v.getCamera()->getGraphicsContext());
> >  c->setProjectionMatrix(osg::Matrix::ortho2D(0,1024,0,768));
> >
> >  c->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
> >  c->setViewMatrix(osg::Matrix::identity());
> >
> >  c->setAllowEventFocus(false);
> >
> >  v.addSlave(c, false);
> > }
> >
> > int main()
> > {
> >  osg::Camera *c1, *c2;
> >
> >  c1 = new osg::Camera;
> >  c2 = new osg::Camera;
> >
> >  osgViewer::Viewer v;
> >  v.addEventHandler(new osgViewer::StatsHandler());
> >  v.realize();
> >
> >  prepareCamera(c1, v);
> >  c1->setViewport(200,100,1024+200,768+100);
> >  c1->setClearColor(osg::Vec4(1.0,0.0,0.0,1.0));
> >  c1->setRenderOrder(osg::Camera::POST_RENDER);
> >
> >  prepareCamera(c2, v);
> >  c2->setViewport(0,0,1024,768);
> >  c2->setClearColor(osg::Vec4(0.0,1.0,0.0,1.0));
> >  c2->setRenderOrder(osg::Camera::POST_RENDER);
> >
> >  v.getCamera()->setClearColor(osg::Vec4(0.3,0.3,0.3,0.0));
> >  v.getCamera()->setRenderOrder(osg::Camera::PRE_RENDER);
> >
> >  v.run();
> >
> >  return 0;
> > }
> >
> >
> > Thanks,
> >
> > Alberto



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


Re: [osg-users] Slave views

2008-11-19 Thread Alberto Luaces
Well, at least this crash was triggered by the new StatsHandler not standing 
with a null SceneData pointer. When applying some scene, the crash 
disappears.

Regards,

Alberto

El Miércoles 19 Noviembre 2008ES 14:33:46 Smeenk, R.J.M. (Roland) escribió:
> Yes, the crash a known issue.
>
> As a quick workaround we might add switching to a singlethreaded
> threadingmodel automatically in the StatsHandler when activating the
> scene statistics.
>
> --
> Roland
>
>
>
>
> 
>
>   From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of David
> Spilling
>   Sent: woensdag 19 november 2008 14:26
>   To: OpenSceneGraph Users
>   Subject: Re: [osg-users] Slave views
>
>
>   Alberto,
>
>
>
>   When compiling against SVN,
>   the two are shown, but a crash happens when pressing 's'
> several times
>
>
>   I think (someone correct me if I'm wrong) that this is a "known
> issue", and something to do with the thread safety of the stats handler,
> and/or NVIDIA drivers.
>
>   If the former is still the case, then running single-threaded
> might help. Try searching the archives for "crash" and "stats".
>
>   David
>
>
> This e-mail and its contents are subject to the DISCLAIMER at
> http://www.tno.nl/disclaimer/email.html


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


Re: [osg-users] Slave views

2008-11-19 Thread Smeenk, R.J.M. (Roland)
 
Yes, the crash a known issue.
 
As a quick workaround we might add switching to a singlethreaded
threadingmodel automatically in the StatsHandler when activating the
scene statistics.
 
--
Roland
 





From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David
Spilling
Sent: woensdag 19 november 2008 14:26
To: OpenSceneGraph Users
Subject: Re: [osg-users] Slave views


Alberto,



When compiling against SVN,
the two are shown, but a crash happens when pressing 's'
several times


I think (someone correct me if I'm wrong) that this is a "known
issue", and something to do with the thread safety of the stats handler,
and/or NVIDIA drivers.

If the former is still the case, then running single-threaded
might help. Try searching the archives for "crash" and "stats".

David


This e-mail and its contents are subject to the DISCLAIMER at 
http://www.tno.nl/disclaimer/email.html
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Slave views

2008-11-19 Thread David Spilling
Alberto,

When compiling against SVN,
> the two are shown, but a crash happens when pressing 's' several times


I think (someone correct me if I'm wrong) that this is a "known issue", and
something to do with the thread safety of the stats handler, and/or NVIDIA
drivers.

If the former is still the case, then running single-threaded might help.
Try searching the archives for "crash" and "stats".

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


Re: [osg-users] Slave views

2008-11-19 Thread Robert Osfield
HI Alberto,

You would be best to put the viewer.realize() till after all the camera setup.

Robert.

On Wed, Nov 19, 2008 at 12:33 PM, Alberto Luaces <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm having some trouble trying to set some slave cameras, acting as HUDs. I
> have written a small program showing how I'm setting the graph. When running
> with 2.4.0, none of the slave views are shown. When compiling against SVN,
> the two are shown, but a crash happens when pressing 's' several times, so I
> have to be doing something wrong to get such different behaviours with
> several versions of the library. Currently osgWidget is not an option for me
> as I'm tied to 2.4.0 for this project. Here is the tiny code:
>
> #include 
> #include 
> #include 
>
> void prepareCamera(osg::Camera *c, osgViewer::Viewer &v)
> {
>  c->setGraphicsContext(v.getCamera()->getGraphicsContext());
>  c->setProjectionMatrix(osg::Matrix::ortho2D(0,1024,0,768));
>
>  c->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
>  c->setViewMatrix(osg::Matrix::identity());
>
>  c->setAllowEventFocus(false);
>
>  v.addSlave(c, false);
> }
>
> int main()
> {
>  osg::Camera *c1, *c2;
>
>  c1 = new osg::Camera;
>  c2 = new osg::Camera;
>
>  osgViewer::Viewer v;
>  v.addEventHandler(new osgViewer::StatsHandler());
>  v.realize();
>
>  prepareCamera(c1, v);
>  c1->setViewport(200,100,1024+200,768+100);
>  c1->setClearColor(osg::Vec4(1.0,0.0,0.0,1.0));
>  c1->setRenderOrder(osg::Camera::POST_RENDER);
>
>  prepareCamera(c2, v);
>  c2->setViewport(0,0,1024,768);
>  c2->setClearColor(osg::Vec4(0.0,1.0,0.0,1.0));
>  c2->setRenderOrder(osg::Camera::POST_RENDER);
>
>  v.getCamera()->setClearColor(osg::Vec4(0.3,0.3,0.3,0.0));
>  v.getCamera()->setRenderOrder(osg::Camera::PRE_RENDER);
>
>  v.run();
>
>  return 0;
> }
>
>
> Thanks,
>
> Alberto
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Slave views

2008-11-19 Thread Alberto Luaces
Hello,

I'm having some trouble trying to set some slave cameras, acting as HUDs. I 
have written a small program showing how I'm setting the graph. When running 
with 2.4.0, none of the slave views are shown. When compiling against SVN, 
the two are shown, but a crash happens when pressing 's' several times, so I 
have to be doing something wrong to get such different behaviours with 
several versions of the library. Currently osgWidget is not an option for me 
as I'm tied to 2.4.0 for this project. Here is the tiny code:

#include 
#include 
#include 

void prepareCamera(osg::Camera *c, osgViewer::Viewer &v)
{
  c->setGraphicsContext(v.getCamera()->getGraphicsContext());
  c->setProjectionMatrix(osg::Matrix::ortho2D(0,1024,0,768));

  c->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
  c->setViewMatrix(osg::Matrix::identity());

  c->setAllowEventFocus(false);

  v.addSlave(c, false);
}

int main()
{
  osg::Camera *c1, *c2;

  c1 = new osg::Camera;
  c2 = new osg::Camera;

  osgViewer::Viewer v;
  v.addEventHandler(new osgViewer::StatsHandler());
  v.realize();

  prepareCamera(c1, v);
  c1->setViewport(200,100,1024+200,768+100);
  c1->setClearColor(osg::Vec4(1.0,0.0,0.0,1.0));
  c1->setRenderOrder(osg::Camera::POST_RENDER);

  prepareCamera(c2, v);
  c2->setViewport(0,0,1024,768);
  c2->setClearColor(osg::Vec4(0.0,1.0,0.0,1.0));
  c2->setRenderOrder(osg::Camera::POST_RENDER);

  v.getCamera()->setClearColor(osg::Vec4(0.3,0.3,0.3,0.0));
  v.getCamera()->setRenderOrder(osg::Camera::PRE_RENDER);

  v.run();

  return 0;
}


Thanks,

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