accum.h

00001 
00002 /* Copyright (c) 2009-2010, Stefan Eilemann <eile@equalizergraphics.com>
00003  *               2009, Sarah Amsellem <sarah.amsellem@gmail.com>
00004  *
00005  * This library is free software; you can redistribute it and/or modify it under
00006  * the terms of the GNU Lesser General Public License version 2.1 as published
00007  * by the Free Software Foundation.
00008  *  
00009  * This library is distributed in the hope that it will be useful, but WITHOUT
00010  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00011  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00012  * details.
00013  * 
00014  * You should have received a copy of the GNU Lesser General Public License
00015  * along with this library; if not, write to the Free Software Foundation, Inc.,
00016  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00017  */
00018 
00019 #ifndef EQUTIL_ACCUM_H
00020 #define EQUTIL_ACCUM_H
00021 
00022 #include <eq/client/os.h>  // for GLEW
00023 
00024 namespace eq
00025 {
00026     class PixelViewport;
00027 
00028 namespace util
00029 {
00030     class AccumBufferObject;
00031 
00040     class Accum
00041     {
00042     public: 
00044         EQ_EXPORT Accum( GLEWContext* const glewContext );
00045 
00047         EQ_EXPORT ~Accum();
00048 
00055         EQ_EXPORT bool init( const PixelViewport& pvp, GLuint textureFormat );
00056 
00060         EQ_EXPORT void exit();
00061 
00069         EQ_EXPORT bool resize( const int width, const int height );
00070 
00074         EQ_EXPORT void clear();
00075 
00079         EQ_EXPORT void accum();
00080 
00084         EQ_EXPORT void display();
00085 
00092         EQ_EXPORT uint32_t getMaxSteps() const;
00093 
00099         EQ_EXPORT uint32_t getNumSteps() const { return _numSteps; }
00100 
00109         EQ_EXPORT void setTotalSteps( uint32_t totalSteps )
00110             { _totalSteps = totalSteps; }
00111         EQ_EXPORT uint32_t getTotalSteps() { return _totalSteps; }
00112 
00119         EQ_EXPORT bool usesFBO() const;
00120 
00127         EQ_EXPORT static bool usesFBO( const GLEWContext* glewContext );
00128 
00129         GLEWContext* glewGetContext() { return _glewContext; }
00130         const GLEWContext* glewGetContext() const { return _glewContext; }
00131 
00132     private:
00133         GLEWContext* const _glewContext;
00134 
00135         int _width;
00136         int _height;
00137 
00138         AccumBufferObject* _abo;
00139         uint32_t _numSteps;
00140         uint32_t _totalSteps;
00141     };
00142 }
00143 }
00144 
00145 #endif //EQUTIL_ACCUMULATION_H
Generated on Sat Feb 6 12:59:39 2010 for Equalizer 0.9.1 by  doxygen 1.6.1