Equalizer
1.2.1
|
A C++ class to abstract OpenGL pixel buffer objects. More...
#include <pixelBufferObject.h>
Public Member Functions | |
PixelBufferObject (const GLEWContext *glewContext, const bool threadSafe) | |
Construct a new Pixel Buffer Object. | |
virtual | ~PixelBufferObject () |
Destruct the Frame Buffer Object. | |
virtual bool | setup (const ssize_t size, const GLuint type) |
Initialize the Pixel Buffer Object. | |
virtual void | destroy () |
De-initialize the pixel buffer object. | |
virtual const void * | mapRead () const |
Bind the PBO and map its data for reading. | |
virtual void * | mapWrite () |
Bind the PBO and mappe its data for writing. | |
virtual void | unmap () const |
Unmap and unbind the PBO. | |
virtual bool | bind () const |
Bind the PBO. | |
virtual void | unbind () const |
Unbind the PBO. | |
ssize_t | getSize () const |
const co::Error & | getError () const |
bool | isInitialized () const |
bool | isThreadSafe () const |
GLuint | getID () const |
A C++ class to abstract OpenGL pixel buffer objects.
If multiple PBOs of the same read/write type are used in the same glContext they should be binded/mapped and unbinded/unmapped sequentially.
If thread-safe mode is used, buffer binding and mapping is locked until the corresponding unbind/unmap happened.
On correct PBO usage see: http://www.songho.ca/opengl/gl_pbo.html
Definition at line 44 of file pixelBufferObject.h.
eq::util::PixelBufferObject::PixelBufferObject | ( | const GLEWContext * | glewContext, |
const bool | threadSafe | ||
) |
Construct a new Pixel Buffer Object.
glewContext | the OpenGL function table. |
threadSafe | true if PBO shall use locks to synchronize access. |
virtual bool eq::util::PixelBufferObject::bind | ( | ) | const [virtual] |
Bind the PBO.
virtual void eq::util::PixelBufferObject::destroy | ( | ) | [virtual] |
De-initialize the pixel buffer object.
const co::Error& eq::util::PixelBufferObject::getError | ( | ) | const |
GLuint eq::util::PixelBufferObject::getID | ( | ) | const |
ssize_t eq::util::PixelBufferObject::getSize | ( | ) | const |
bool eq::util::PixelBufferObject::isInitialized | ( | ) | const |
bool eq::util::PixelBufferObject::isThreadSafe | ( | ) | const |
virtual const void* eq::util::PixelBufferObject::mapRead | ( | ) | const [virtual] |
Bind the PBO and map its data for reading.
virtual void* eq::util::PixelBufferObject::mapWrite | ( | ) | [virtual] |
Bind the PBO and mappe its data for writing.
virtual bool eq::util::PixelBufferObject::setup | ( | const ssize_t | size, |
const GLuint | type | ||
) | [virtual] |
Initialize the Pixel Buffer Object.
size | total number of bytes (has to be > 0) |
type | the access type: GL_READ_ONLY_ARB or GL_WRITE_ONLY_ARB |
virtual void eq::util::PixelBufferObject::unbind | ( | ) | const [virtual] |
Unbind the PBO.
virtual void eq::util::PixelBufferObject::unmap | ( | ) | const [virtual] |
Unmap and unbind the PBO.