Equalizer  1.6.1
pixelBufferObject.h
1 
2 /* Copyright (c) 2012, Maxim Makhinya <maxmah@gmail.com>
3  * 2012, Stefan Eilemann <eile@eyescale.ch>
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_PIXELBUFFEROBJECT_H
20 #define EQUTIL_PIXELBUFFEROBJECT_H
21 
22 #include <lunchbox/lock.h>
23 
24 #include <eq/client/api.h>
25 #include <eq/client/types.h>
26 #include <eq/fabric/error.h> // enum
27 
28 namespace eq
29 {
30 namespace util
31 {
32 namespace detail { class PixelBufferObject; }
33 
45  {
46  public:
54  EQ_API PixelBufferObject( const GLEWContext* glewContext,
55  const bool threadSafe );
56 
58  EQ_API virtual ~PixelBufferObject();
59 
70  EQ_API virtual bool setup( const size_t size, const unsigned type );
71 
73  EQ_API virtual void destroy();
74 
81  EQ_API virtual const void* mapRead() const;
82 
89  EQ_API virtual void* mapWrite();
90 
97  EQ_API virtual void unmap() const;
98 
100  EQ_API virtual bool bind() const;
101 
103  EQ_API virtual void unbind() const;
104 
106  EQ_API size_t getSize() const;
107 
109  EQ_API const eq::fabric::Error& getError() const;
110 
112  EQ_API bool isInitialized() const;
113 
115  EQ_API bool isThreadSafe() const;
116 
118  unsigned getID() const;
119 
120  private:
121  detail::PixelBufferObject* const _impl;
122  };
123 }
124 }
125 
126 #endif // EQUTIL_PIXELBUFFEROBJECT_H
virtual void unbind() const
Unbind the PBO.
unsigned getID() const
virtual void destroy()
Unbind and de-initialize the pixel buffer object.
Error
Defines errors produced by Equalizer classes.
virtual void unmap() const
Unmap and unbind the PBO.
PixelBufferObject(const GLEWContext *glewContext, const bool threadSafe)
Construct a new pixel buffer object.
const eq::fabric::Error & getError() const
virtual bool bind() const
Bind the PBO.
virtual const void * mapRead() const
Bind the PBO and map its data for reading.
virtual void * mapWrite()
Bind the PBO and map its data for writing.
virtual bool setup(const size_t size, const unsigned type)
Initialize the pixel buffer object.
virtual ~PixelBufferObject()
Destruct the pixel buffer object.
A C++ class to abstract OpenGL pixel buffer objects.