Basic Image AlgorithmS Library 2.8.0

OffscreenRendering.hh

00001 #ifndef __OFFSCREENRENDERING_HH__
00002 #define __OFFSCREENRENDERING_HH__
00003 
00004 #include <bias_config.h>
00005 
00006 #ifndef BIAS_HAVE_OPENGL
00007 #  error You need BIAS with USE_OpenGL Please recompile BIAS.
00008 #endif // BUILD_GLviewer
00009 
00010 #include <Gui/biasgl.h>
00011 #include <Base/Debug/Debug.hh>
00012 
00013 #if defined(BIAS_HAVE_GLEW)
00014 
00015 #define BIAS_HAVE_CLASS_OFFSCREENRENDERING
00016 
00017 #include <OpenGLFramework/Base/glfFramebufferObject.hh>
00018 #include <OpenGLFramework/Base/glfRenderbuffer.hh>
00019 #include <OpenGLFramework/Base/glfTexture2D.hh>
00020 
00021 namespace BIAS {
00022 
00023   /** @brief Utility class for offscreen rendering used by GLProjection
00024       @warning This class can only be used if
00025                BIAS_HAVE_CLASS_OFFSCREENRENDERING is defined.
00026       @ingroup g_glviewer
00027       @author jkollmann */
00028   class BIASGLviewer_EXPORT OffscreenRendering : public BIAS::Debug
00029   {
00030   public:
00031     OffscreenRendering();
00032     ~OffscreenRendering();
00033 
00034     int Init(int imgWidth, int imgHeight);
00035     bool IsInitialized() const;
00036     BIAS::glfFramebufferObject* GetFBO();
00037 
00038   private:
00039     BIAS::glfRenderbuffer depthBuffer_;
00040     BIAS::glfRenderbuffer colorBuffer_;
00041     BIAS::glfFramebufferObject fbo_;
00042     bool initialized_;
00043 
00044     OffscreenRendering(const OffscreenRendering&) {};
00045     OffscreenRendering& operator=(const OffscreenRendering&) {return (*this);};    
00046     
00047   };
00048   
00049 }
00050 
00051 #endif
00052 #endif // __OFFSCREENRENDERING_HH__
00053 
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends