00001 #ifndef FRAMEBUFFER_H 00002 #define FRAMEBUFFER_H 00003 00004 #include "Types.h" 00005 #include "Renderbuffer.h" 00006 #include "RelationalNode.h" 00007 #include "PropertyProxyContainer.h" 00008 #include "BindingInterface.h" 00009 00010 using namespace std; 00011 00012 namespace RenderTools { 00013 00019 class Framebuffer : public BindingInterface, public AbstractPropertyContainer { 00020 public: 00021 00022 Framebuffer( void ); 00023 virtual ~Framebuffer( void ); 00024 00025 static PropertyPtr create( const XMLNodePtr & xml = XMLNodePtr() ); 00026 virtual void createProperties( void ); 00027 virtual const string getTypeName( bool ofComponent = false ) const; 00028 virtual void onInitialize( void ); 00029 virtual void onBind( int unit = -1 ); 00030 virtual void onUnbind( int unit = -1 ); 00031 00032 void addRenderbuffer( const RenderbufferPtr buffer, bool send = true ); 00033 void addRenderbuffer( const string buffer, bool send = true ); 00034 bool hasColorBuffer( void ) const; 00035 bool hasStencilBuffer( void ) const; 00036 bool hasDepthBuffer( void ) const; 00037 GLuint getID( void ) const; 00038 GLuint getWidth( void ) const; 00039 GLuint getHeight( void ) const; 00040 00041 static void copy( const FramebufferPtr from, const FramebufferPtr to ); 00042 static void copy( const SamplerPtr s, GLuint to ); 00043 00044 static void setDefaultFramebufferID( GLuint id ); 00045 static void setDefaultReadbufferID( GLuint id ); 00046 static void setDefaultDrawbufferID( GLuint id ); 00047 00048 static GLuint getDefaultFramebufferID( void ); 00049 static GLuint getDefaultReadbufferID( void ); 00050 static GLuint getDefaultDrawbufferID( void ); 00051 00052 private: 00053 GLuint m_id; 00054 GLuint m_w; 00055 GLuint m_h; 00056 00057 RenderbufferProxyContainerPtr m_colorbuffers; 00058 RenderbufferProxyPtr m_depthbuffer; 00059 RenderbufferProxyPtr m_stencilbuffer; 00060 00061 static GLuint s_defaultFramebufferID; 00062 static GLuint s_defaultReadbufferID; 00063 static GLuint s_defaultDrawbufferID; 00064 }; 00065 00066 }; // namespace RenderTools 00067 00068 00069 #endif
1.5.8