A C++ class to abstract OpenGL pixel buffer objects.
More...
#include <pixelBufferObject.h>
|
EQ_API | PixelBufferObject (const GLEWContext *glewContext) |
| Construct a new pixel buffer object. More...
|
|
virtual EQ_API | ~PixelBufferObject () |
| Destruct the pixel buffer object.
|
|
virtual EQ_API Error | setup (const size_t size, const unsigned type) |
| Initialize the pixel buffer object. More...
|
|
virtual EQ_API void | destroy () |
| Unbind and de-initialize the pixel buffer object. More...
|
|
virtual EQ_API const void * | mapRead () const |
| Bind the PBO and map its data for reading. More...
|
|
virtual EQ_API void * | mapWrite () |
| Bind the PBO and map its data for writing. More...
|
|
virtual EQ_API void | unmap () const |
| Unmap and unbind the PBO. More...
|
|
virtual EQ_API bool | bind () const |
| Bind the PBO. More...
|
|
virtual EQ_API void | unbind () const |
| Unbind the PBO. More...
|
|
EQ_API size_t | getSize () const |
|
EQ_API bool | isInitialized () const |
|
unsigned | 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 bound/mapped and unbound/unmapped sequentially.
Buffer binding and mapping is locked until the corresponding unbind/unmap happened, making this class thread-safe to use.
On correct PBO usage see: http://www.songho.ca/opengl/gl_pbo.html
Definition at line 45 of file pixelBufferObject.h.
EQ_API eq::util::PixelBufferObject::PixelBufferObject |
( |
const GLEWContext * |
glewContext | ) |
|
Construct a new pixel buffer object.
- Parameters
-
glewContext | the OpenGL function table. |
- Version
- 1.3
virtual EQ_API bool eq::util::PixelBufferObject::bind |
( |
| ) |
const |
|
virtual |
virtual EQ_API void eq::util::PixelBufferObject::destroy |
( |
| ) |
|
|
virtual |
Unbind and de-initialize the pixel buffer object.
- Version
- 1.3
unsigned eq::util::PixelBufferObject::getID |
( |
| ) |
const |
- Returns
- OpenGL ID
- Version
- 1.3.2
EQ_API size_t eq::util::PixelBufferObject::getSize |
( |
| ) |
const |
- Returns
- the allocated size of the PBO.
- Version
- 1.3
EQ_API bool eq::util::PixelBufferObject::isInitialized |
( |
| ) |
const |
- Returns
- true if the pbo is intialized.
- Version
- 1.3
virtual EQ_API const void* eq::util::PixelBufferObject::mapRead |
( |
| ) |
const |
|
virtual |
Bind the PBO and map its data for reading.
- Returns
- pointer to the PBO memory
- Version
- 1.3
virtual EQ_API void* eq::util::PixelBufferObject::mapWrite |
( |
| ) |
|
|
virtual |
Bind the PBO and map its data for writing.
- Returns
- pointer to the PBO memory
- Version
- 1.3
virtual EQ_API Error eq::util::PixelBufferObject::setup |
( |
const size_t |
size, |
|
|
const unsigned |
type |
|
) |
| |
|
virtual |
Initialize the pixel buffer object.
The PBO is bound after a successful operation.
- Parameters
-
size | total number of bytes (not 0) |
type | the access type: GL_READ_ONLY_ARB or GL_WRITE_ONLY_ARB |
- Returns
- ERROR_NONE on success, the Error code on failure.
- Version
- 1.3
virtual EQ_API void eq::util::PixelBufferObject::unbind |
( |
| ) |
const |
|
virtual |
Unbind the PBO.
- Version
- 1.3
virtual EQ_API void eq::util::PixelBufferObject::unmap |
( |
| ) |
const |
|
virtual |
Unmap and unbind the PBO.
- Returns
- pointer to the PBO memory
- Version
- 1.3
The documentation for this class was generated from the following file: