update:

It works with new camera, you just need to reassign scene to viewer.

        void setWindow(unsigned int width, unsigned int height, bool 
fullScreen) {
            osg::ref_ptr<osg::Node> scene = mViewer->getSceneData();
            if (fullScreen)
...
...
            mViewer->setCamera(cam);
            mViewer->setSceneData(0);//needed as viewer would not do a thing if 
you set same scene twice.
            mViewer->setSceneData(scene);
        }

Cheers.


02.08.2012, 18:21, "Sergey Polischuk" <[email protected]>:
> Hi
>
> In your example:
> change line 34
>             osg::ref_ptr<osg::Camera> cam = new osg::Camera;
> to
>             osg::ref_ptr<osg::Camera> cam = mViewer->getCamera();
> and it should work.
>
> IDK why it doesn't work with new camera though...
>
> Cheers,
> Sergey.
>
> 02.08.2012, 14:58, "michael kapelko" <[email protected]>:
>
>>  Hi.
>>  I want to have window resize with full screen in my OSG game, but I'm
>>  facing a problem. When I resize the window second time, the loaded
>>  resources are lost. The resize is done by first setting screen
>>  resolution and then creating graphics context.
>>  How can I implement window resize with full screen without reloading
>>  all game resources?
>>  Thanks.
>>
>>  PS: Sample source code is attached.
>>
>>  _______________________________________________
>>  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
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to