Hi Steven,

I think that this issue might have been resolved in 2.8.2.  I would
strongly recommend upgrading to 2.8.2.  The API changes should be
pretty isolated w.r.t 2.2 so porting should be quite straight forward
and you'll get lots and lots of bug fixes as well as general
improvements.  And.. you'll be far easier to support as trying to
remember little details of old code is beyond my meager brain is
capable of.

Robert.

On Thu, Sep 3, 2009 at 7:56 PM, Steven Powers<[email protected]> wrote:
> Hi,
> OSG 2.2
> The original issue:
> I have a graphics context with multiple cameras. Some of which are rendering 
> to an attached image. When I resize the graphics context ALL of the camera's 
> viewports are resized. I did not want this to happen so I defined my own 
> ResizedCallback which will only resize Cameras that I tell it to.
>
> Issue with ResizedCallback:
> I can resize the camera's I want to and leave the others the way they are 
> just fine. But since I defined my own ResizedCallback GraphicsContext no 
> longer updates the following values as it would normally do in 
> GraphicsContext::resizedImplementation().
>
>
> Code:
>
>    _traits->x = x;
>    _traits->y = y;
>    _traits->width = width;
>    _traits->height = height;
>
>
>
>
> Now when I query these values from GraphicsContext they no longer equate to 
> the values I set by resizing the context.
>
> This is because GraphicsContext::resizedImplementation() is not called when a 
> ResizedCallback is set. It is impossible to set the traits values in the 
> ResizedCallback since the values are private.
>
> To repair this I would change:
>
>
> Code:
>
>        void resized(int x, int y, int width, int height)
>        {
>            if (_resizedCallback.valid()) 
> _resizedCallback->resizedImplementation(this, x, y, width, height);
>            else resizedImplementation(x, y, width, height);
>        }
>
>
>
>
>
> to
>
>
> Code:
>
>        void resized(int x, int y, int width, int height)
>        {
>            if (_resizedCallback.valid()) 
> _resizedCallback->resizedImplementation(this, x, y, width, height);
>            else resizedImplementation(x, y, width, height);
>    _traits->x = x;
>    _traits->y = y;
>    _traits->width = width;
>    _traits->height = height;
>
>
>  }
>
>
>
>
>
> Or something similar.
>
>
> Thank you!
>
> Cheers,
> Steven[/code]
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=17030#17030
>
>
>
>
>
> _______________________________________________
> 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