Equalizer  1.6.1
accum.h
1 
2 /* Copyright (c) 2009-2012, Stefan Eilemann <eile@equalizergraphics.com>
3  * 2009, Sarah Amsellem <sarah.amsellem@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License version 2.1 as published
7  * by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef EQUTIL_ACCUM_H
20 #define EQUTIL_ACCUM_H
21 
22 #include <eq/util/types.h>
23 
24 namespace eq
25 {
26 namespace util
27 {
28 namespace detail { class Accum; }
29 
39 class Accum
40 {
41 public:
43  EQ_API Accum( const GLEWContext* const glewContext );
44 
46  EQ_API ~Accum();
47 
56  EQ_API bool init( const PixelViewport& pvp, unsigned textureFormat );
57 
59  EQ_API void exit();
60 
69  EQ_API bool resize( const PixelViewport& pvp );
70  EQ_API bool resize( const int width, const int height );
71 
73  EQ_API void clear();
74 
79  EQ_API void accum();
80 
85  EQ_API void display();
86 
93  EQ_API uint32_t getMaxSteps() const;
94 
101  EQ_API uint32_t getNumSteps() const;
102 
112  EQ_API void setTotalSteps( uint32_t totalSteps );
113 
115  EQ_API uint32_t getTotalSteps();
116 
123  EQ_API bool usesFBO() const;
124 
132  EQ_API static bool usesFBO( const GLEWContext* glewContext );
133 
134  EQ_API const GLEWContext* glewGetContext() const;
135 
136 private:
137  detail::Accum* const impl_;
138 };
139 }
140 }
141 
142 #endif // EQUTIL_ACCUM_H
bool resize(const PixelViewport &pvp)
Resize the accumulation buffer.
~Accum()
Destruct the accumulation buffer.
Accum(const GLEWContext *const glewContext)
Construct a new accumulation buffer.
uint32_t getTotalSteps()
void setTotalSteps(uint32_t totalSteps)
Set the total number of accumulation steps that will be done.
bool usesFBO() const
Test if the accumulation uses the FBO implementation.
void display()
Copy the result of the accumulation to the current draw buffer.
void accum()
Accumulate a frame from the read buffer into the accumulation buffer.
bool init(const PixelViewport &pvp, unsigned textureFormat)
Initialize the accumulation buffer.
A C++ class to abstract an accumulation buffer.
Definition: accum.h:39
uint32_t getMaxSteps() const
Get the maximum number of accumulation steps possible.
void clear()
Clear the accumulation buffer.
uint32_t getNumSteps() const
Get the current number of accumulation steps done.
void exit()
Exit the accum buffer.