Added a local osg::State to the pbuffer implementation.
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
MyRenderToTextureStage::MyRenderToTextureStage()
|
||||
{
|
||||
_pbuffer = 0L;
|
||||
_localState = new osg::State;
|
||||
}
|
||||
|
||||
MyRenderToTextureStage::~MyRenderToTextureStage()
|
||||
@@ -46,7 +47,7 @@ void MyRenderToTextureStage::draw(osg::State& state, osgUtil::RenderLeaf*& previ
|
||||
_pbuffer->makeCurrent();
|
||||
|
||||
// Render in p-buffer.
|
||||
RenderStage::draw(state,previous);
|
||||
RenderStage::draw(*_localState,previous);
|
||||
|
||||
// restore window's context as current.
|
||||
if (!::wglMakeCurrent(hdc, hglrc))
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#define RENDERTOTEXTURESTAGE 1
|
||||
|
||||
#include <osg/Texture2D>
|
||||
#include <osg/State>
|
||||
|
||||
#include <osgUtil/RenderStage>
|
||||
|
||||
@@ -49,9 +50,10 @@ class /*OSGUTIL_EXPORT*/ MyRenderToTextureStage : public osgUtil::RenderStage
|
||||
|
||||
virtual ~MyRenderToTextureStage();
|
||||
|
||||
osg::ref_ptr<osg::Texture2D> _texture;
|
||||
osg::ref_ptr<osg::Image> _image;
|
||||
PBuffer* _pbuffer;
|
||||
osg::ref_ptr<osg::Texture2D> _texture;
|
||||
osg::ref_ptr<osg::Image> _image;
|
||||
osg::ref_ptr<osg::State> _localState;
|
||||
PBuffer* _pbuffer;
|
||||
};
|
||||
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user