Further FBO support work.

This commit is contained in:
Robert Osfield
2005-06-16 14:01:38 +00:00
parent 1641cd7b54
commit c5cad6982e
6 changed files with 86 additions and 272 deletions

View File

@@ -15,6 +15,7 @@
#define OSGUTIL_RENDERTOTEXTURESTAGE 1
#include <osg/Texture2D>
#include <osg/FrameBufferObject>
#include <osgUtil/RenderStage>
@@ -51,6 +52,10 @@ class OSGUTIL_EXPORT RenderToTextureStage : public RenderStage
void setImageReadPixelDataType(GLenum type) { _imageReadPixelDataType = type; }
GLenum getImageReadPixelDataType() const { return _imageReadPixelDataType; }
void setFrameBufferObject(osg::FrameBufferObject* fbo) { _fbo = fbo; }
osg::FrameBufferObject* getFrameBufferObject() { return _fbo.get(); }
const osg::FrameBufferObject* getFrameBufferObject() const { return _fbo.get(); }
virtual void draw(osg::State& state,RenderLeaf*& previous);
@@ -61,10 +66,12 @@ class OSGUTIL_EXPORT RenderToTextureStage : public RenderStage
virtual ~RenderToTextureStage();
osg::ref_ptr<osg::Texture2D> _texture;
osg::ref_ptr<osg::Image> _image;
GLenum _imageReadPixelFormat;
GLenum _imageReadPixelDataType;
osg::ref_ptr<osg::Texture2D> _texture;
osg::ref_ptr<osg::Image> _image;
GLenum _imageReadPixelFormat;
GLenum _imageReadPixelDataType;
osg::ref_ptr<osg::FrameBufferObject> _fbo;
};