Introduced Camera::resizeAttachments(int width, int height) to resize all the Texture and Image assigned the the Camera attachments.

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14810 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2015-03-31 15:08:13 +00:00
parent 296c12a8e9
commit 99f7bfab3b
3 changed files with 78 additions and 19 deletions

View File

@@ -112,25 +112,7 @@ public:
{
camera->setViewport(0, 0, width, height);
osg::Camera::BufferAttachmentMap& cbam = camera->getBufferAttachmentMap();
for(osg::Camera::BufferAttachmentMap::iterator itr = cbam.begin();
itr != cbam.end();
++itr)
{
osg::Camera::Attachment& attachment = itr->second;
if (attachment._texture.get())
{
osg::Texture2D* texture2D = dynamic_cast<osg::Texture2D*>(attachment._texture.get());
if (texture2D)
{
OSG_NOTICE<<"Resetting Texture size"<<std::endl;
texture2D->setTextureSize(width, height);
texture2D->dirtyTextureObject();
}
}
}
camera->dirtyAttachmentMap();
camera->resizeAttachments(width, height);
}
virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa, osg::Object* object, osg::NodeVisitor* nv)