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