Introduced osg::Camera::resize(..) method and associated enum thus:
enum ResizeMask
{
RESIZE_VIEWPORT=1,
RESIZE_ATTACHMENTS=2,
RESIZE_PROJECTIONMATRIX=4,
RESIZE_DEFAULT=RESIZE_VIEWPORT|RESIZE_ATTACHMENTS
};
/** Resize, to the specified width and height, the viewport, attachments and projection matrix according to the resizeMask provided.
* Note, the adjustment of the projection matrix is done if the RESIZE_PROJECTIONMATRIX mask to set and according to the rules specified in the ProjectionResizePolicy. */
void resize(int width, int height, int resizeMask=RESIZE_DEFAULT);
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14811 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
@@ -108,13 +108,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void resizeRTTCamera(osg::Camera* camera,unsigned int width, unsigned int height)
|
||||
{
|
||||
camera->setViewport(0, 0, width, height);
|
||||
|
||||
camera->resizeAttachments(width, height);
|
||||
}
|
||||
|
||||
virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa, osg::Object* object, osg::NodeVisitor* nv)
|
||||
{
|
||||
osg::Camera* camera = dynamic_cast<osg::Camera*>(object);
|
||||
@@ -130,11 +123,8 @@ public:
|
||||
OSG_NOTICE<<" WindowWidth="<<ea.getWindowWidth()<<std::endl;
|
||||
OSG_NOTICE<<" WindowHeight="<<ea.getWindowHeight()<<std::endl;
|
||||
|
||||
// reset the Camera and associated Texture's to make sure it tracks the new window size.
|
||||
int width = ea.getWindowWidth();
|
||||
int height = ea.getWindowHeight();
|
||||
|
||||
resizeRTTCamera(camera, width, height);
|
||||
// reset the Camera viewpoer and associated Texture's to make sure it tracks the new window size.
|
||||
camera->resize(ea.getWindowWidth(), ea.getWindowHeight());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user