Hi Eric,

I have a camera drawback and have some legacy OpenGL code that needs
to know the size of the viewport. I've tried various combinations of
Viewer->GetCamera() in the main. And the callback class does not seem
to have anything that can get to the viewport.

I suppose it did not work because you checked before viewer windows were realized (created). You may try viewer.realize() first and then checking the camera viewport.

Using CameraDraw callback should be fine as well.

Example:

void MyCameraDrawCallback::operator () (osg::RenderInfo& renderInfo) const
{
   ...
osg::Viewport * viewport = renderInfo.getCurrentCamera()->getViewport();
   ...
}


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

Reply via email to