Equalizer  1.12.0
Parallel Rendering Framework
pixelBufferObject.h
1 
2 /* Copyright (c) 2012, Maxim Makhinya <maxmah@gmail.com>
3  * 2012-2014, 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/api.h>
25 #include <eq/error.h> // enum
26 #include <eq/types.h>
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 Error 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 bool isInitialized() const;
110 
112  EQ_API bool isThreadSafe() const;
113 
115  unsigned getID() const;
116 
117 private:
118  PixelBufferObject( const PixelBufferObject& ) = delete;
119  PixelBufferObject& operator=( const PixelBufferObject& ) = delete;
120  detail::PixelBufferObject* const _impl;
121 };
122 }
123 }
124 
125 #endif // EQUTIL_PIXELBUFFEROBJECT_H
virtual EQ_API Error setup(const size_t size, const unsigned type)
Initialize the pixel buffer object.
EQ_API size_t getSize() const
A C++ class to abstract OpenGL pixel buffer objects.
EQ_API bool isThreadSafe() const
virtual EQ_API void * mapWrite()
Bind the PBO and map its data for writing.
virtual EQ_API void unbind() const
Unbind the PBO.
EQ_API PixelBufferObject(const GLEWContext *glewContext, const bool threadSafe)
Construct a new pixel buffer object.
virtual EQ_API bool bind() const
Bind the PBO.
The Equalizer client library.
Definition: eq/agl/types.h:23
unsigned getID() const
EQ_API bool isInitialized() const
virtual EQ_API const void * mapRead() const
Bind the PBO and map its data for reading.
virtual EQ_API ~PixelBufferObject()
Destruct the pixel buffer object.
virtual EQ_API void unmap() const
Unmap and unbind the PBO.
virtual EQ_API void destroy()
Unbind and de-initialize the pixel buffer object.