25 #ifndef WGEOFFSCREENRENDERPASS_H
26 #define WGEOFFSCREENRENDERPASS_H
31 #include <osg/FrameBufferObject>
33 #include "../WGEUtils.h"
34 #include "../WGETexture.h"
35 #include "../WGECamera.h"
50 typedef osg::ref_ptr< WGEOffscreenRenderPass >
RefPtr;
55 typedef osg::ref_ptr< const WGEOffscreenRenderPass >
ConstRefPtr;
79 WGEOffscreenRenderPass(
size_t textureWidth,
size_t textureHeight, osg::ref_ptr< WGETextureHud > hud, std::string name,
int num = 0 );
94 void attach( BufferComponent buffer, osg::ref_ptr< osg::Texture2D > texture );
105 void attach( BufferComponent buffer, osg::ref_ptr< osg::Image > image );
119 osg::ref_ptr< osg::Texture2D >
attach( BufferComponent buffer, GLint internalFormat = GL_RGBA );
128 void detach( BufferComponent buffer );
137 template <
typename T >
138 void bind( osg::ref_ptr< T > texture,
size_t unit = 0 );
147 osg::ref_ptr< osg::Texture2D >
createTexture( GLint internalFormat = GL_RGBA );
184 virtual void addUniform( osg::ref_ptr< osg::Uniform > uniform );
199 osg::ref_ptr<osg::FrameBufferObject>
m_fbo;
204 osg::ref_ptr< WGETextureHud >
m_hud;
213 template <
typename T >
219 #endif // WGEOFFSCREENRENDERPASS_H