Hi Partick, A dynamic_cast<osg::Viewport*>(vp) will return 0 if the object vp is not an osg::Viewport or vp doesn't subclass from osg::Viewport. I knowing about osgSDL so I can't comment on how osgSDL::Viewport is implemented. This a basic C++ that you really should look at C++ texts for understanding of.
Might I suggest that you just copy the viewport info across. Robert. On Fri, Nov 21, 2008 at 5:34 PM, Patrick Castonguay <[EMAIL PROTECTED]> wrote: > Hi sorry for the newbie question... > > I am trying to merge to apps that use different libraries... One uses > osgSDL:: and the other, which needs to be integrated with the first, uses > osg::. where I am having trouble is setting a camera to do RTT. I have a > osgSDL::Viewport to for which I want a camera to project the scene to a > texture! I am not realy certain how this works but static or const casts > canot convert. > > As well, if I use dynamic_cast, the operation proceeds but the pointer to my > osg::Viewport created as shuch (osg::Viewport* ovp = > dynamic_cast<osg::Viewport *>( vp );) is still set to NULL eventhough my > osgSDL::Vewport* vp contains valid info... The camera viewport gets set no > problem to the null viewport but the second app I am using (osgPPU) crashes > when it tries to create a new local viewport using the copy operator as > such: > osg::ref_ptr<osg::Viewport> vp = new > osg::Viewport(*(fp._processor->getCamera()->getViewport())); (normal as the > pointer is still null) > > Last thing is if I use reinterpret_cast, my assignment to the camera does > not get accepted and my app crashes there... > > Any idea how I could get these two to work togethere? > Thanks > > Patrick Castonguay > H: 613 435 2235 > C: 613 325 1341 > > Technology Innovation Management (TIM) Student - Modeling and Simulation > stream > Carleton University, Ottawa, ON > > _______________________________________________ > 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

