Equalizer  1.13.0
Parallel Rendering Framework
accumBufferObject.h
1 
2 /* Copyright (c) 2009-2013, 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_ACCUMBUFFEROBJECT_H
20 #define EQUTIL_ACCUMBUFFEROBJECT_H
21 
22 #include <eq/util/frameBufferObject.h> // base class
23 #include <eq/util/types.h>
24 
25 #include <eq/fabric/pixelViewport.h> // member
26 
27 namespace eq
28 {
29 namespace util
30 {
36 {
37 public:
39  EQ_API explicit AccumBufferObject( const GLEWContext* const glewContext );
40 
42  EQ_API ~AccumBufferObject();
43 
56  EQ_API bool init( const PixelViewport& pvp, const unsigned format );
57 
59  EQ_API void exit();
60 
71  EQ_API void load( const float value );
72 
83  EQ_API void accum( const float value );
84 
95  EQ_API void display( const float value );
96 
106  EQ_API bool resize( const PixelViewport& pvp );
107 
108 private:
109  void _setup( const PixelViewport& pvp );
110  void _reset();
111 
119  void _drawQuadWithTexture( Texture* texture, const PixelViewport& pvp,
120  const float value );
121 
122  Texture* _texture;
123  PixelViewport _pvp;
124  int _previousFBO;
125 };
126 }
127 }
128 
129 #endif // EQUTIL_ACCUMBUFFEROBJECT_H
EQ_API ~AccumBufferObject()
Destruct the Accumulation Buffer Object.
A C++ class to abstract OpenGL frame buffer objects.
EQ_API void load(const float value)
Load the current read buffer into the accumulation buffer.
A wrapper around OpenGL textures.
Definition: texture.h:38
EQ_API void accum(const float value)
Accumulate the current read buffer into the accumulation buffer.
EQ_API bool resize(const PixelViewport &pvp)
Resets the pixel viewport used in display and resizes the accumulation buffer if needed.
EQ_API void exit()
De-initialize the Accumulation Buffer Object.
The Equalizer client library.
Definition: eq/agl/types.h:23
A class to emulate an OpenGL accumulation buffer using an FBO.
EQ_API AccumBufferObject(const GLEWContext *const glewContext)
Construct a new Accumulation Buffer Object.
EQ_API void display(const float value)
Transfer accumulation buffer values to the draw buffer.
EQ_API bool init(const PixelViewport &pvp, const unsigned format)
Initialize the Accumulation Buffer Object.