Hi Akilan,

On 13 September 2012 06:14, Akilan Thangamani
<[email protected]> wrote:
> I have 2 screens to be rendered with texture2D. I created context to each 
> screen with appropriate screen id such a way,
>
> osg::ref_ptr<psg::GraphicsContext::Traits> traits = new .....;
> traits->x = 0;
> traits->y = 0;
> traits->screenNum = 0; //1 for other screen
> trait->width = screen_width;
> trait->height = screen_height;
> trait->doubleBuffer = true;
> trait->sharedContext = 0;
>
> osg::ref_ptr<osg::GraphicsContext> gc = 
> osg::GraphicsContext::createGraphicsContext(trait.get());
>
> The gc of each screen is set to a camera and camera as slave to view.
> When I render texture to both the screen I get the display fine. As soon as I 
> try to remove one of the screen context using gc->close() and recreate again 
> for the same screen, I get such an error. Further, I couldn't render any 
> texture the updated screen.

When you say recreate again what exactly do you mean?

Do you create a new context?

If so do you also create a new Camera for it as well?  Or just assign
it to the original Camera?

Why do you call close() rather than just removing the Camera from the
View, or View from the CompositeViewer? The later is how I'd tackle
this type of task.

You don't say what type of Viewer you are using or how you've assigned
your Camera so I can't say specifically about how to remove what you
have.

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

Reply via email to