Tessier, Philip a écrit :
> My attempt to use createGraphicsContext() to create an off-screen
> rendering context is failing.  (It's returning NULL.)
>
> I'm using Win32.
>
> What am I missing?
>
> I have added the following to my code:
> osg::GraphicsContext * GetOffscreenGraphicsContext(
>       unsigned a_tex_width,
>       unsigned a_tex_height
>       )
> {
>       osg::ref_ptr<osg::GraphicsContext::Traits> traits=new
> osg::GraphicsContext::Traits;
>
>       traits->width = a_tex_width;
>       traits->height = a_tex_height;
> //    traits->doubleBuffer = true;
>       traits->pbuffer = true;
>
>       osg::ref_ptr<osg::GraphicsContext>
> gc=osg::GraphicsContext::createGraphicsContext(traits.get());
>       // TODO: Above returning NULL!
>
>       return gc.get();
> }
>
> with the following to hook it in:
>               // Setup camera for off-screen rendering.
>               osg::ref_ptr<osg::GraphicsContext> gc=
> GetOffscreenGraphicsContext( tex_width, tex_height);
>               camera->setGraphicsContext(gc.get());
>
> Thanks,
> Phil
>   

Hi,
Found any solution ? I've the same problem, I have a previous solution 
with Producer but I want to port my snapshot application to 2.4 release 
and I can't save any image without a viewer. Anyone have a solution ?

Thanks

-- 
        _
       /_/_      .'''.
    =O(X)))) ...'     `.
       \_\              `.    .'''
                          `..'
"Power corrupts. PowerPoint corrupts absolutely."
My personnal (french) Websites: http://www.xbee.net
and http://www.french-comics-zone.fr.st 

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

Reply via email to