Equalizer  1.6.1
Public Member Functions | List of all members
eq::util::PixelBufferObject Class Reference

A C++ class to abstract OpenGL pixel buffer objects. More...

#include <pixelBufferObject.h>

+ Collaboration diagram for eq::util::PixelBufferObject:

Public Member Functions

 PixelBufferObject (const GLEWContext *glewContext, const bool threadSafe)
 Construct a new pixel buffer object. More...
 
virtual ~PixelBufferObject ()
 Destruct the pixel buffer object.
 
virtual bool setup (const size_t size, const unsigned type)
 Initialize the pixel buffer object. More...
 
virtual void destroy ()
 Unbind and de-initialize the pixel buffer object. More...
 
virtual const void * mapRead () const
 Bind the PBO and map its data for reading. More...
 
virtual void * mapWrite ()
 Bind the PBO and map its data for writing. More...
 
virtual void unmap () const
 Unmap and unbind the PBO. More...
 
virtual bool bind () const
 Bind the PBO. More...
 
virtual void unbind () const
 Unbind the PBO. More...
 
size_t getSize () const
 
const eq::fabric::ErrorgetError () const
 
bool isInitialized () const
 
bool isThreadSafe () const
 
unsigned getID () const
 

Detailed Description

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.

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.

Constructor & Destructor Documentation

eq::util::PixelBufferObject::PixelBufferObject ( const GLEWContext *  glewContext,
const bool  threadSafe 
)

Construct a new pixel buffer object.

Parameters
glewContextthe OpenGL function table.
threadSafetrue if PBO shall use locks to synchronize access.
Version
1.3

Member Function Documentation

virtual bool eq::util::PixelBufferObject::bind ( ) const
virtual

Bind the PBO.

Version
1.3
virtual void eq::util::PixelBufferObject::destroy ( )
virtual

Unbind and de-initialize the pixel buffer object.

Version
1.3
const eq::fabric::Error& eq::util::PixelBufferObject::getError ( ) const
Returns
the reason for the last failed operation.
Version
1.3
unsigned eq::util::PixelBufferObject::getID ( ) const
Returns
OpenGL ID
Version
1.3.2
size_t eq::util::PixelBufferObject::getSize ( ) const
Returns
the allocated size of the PBO.
Version
1.3
bool eq::util::PixelBufferObject::isInitialized ( ) const
Returns
true if the pbo is intialized.
Version
1.3
bool eq::util::PixelBufferObject::isThreadSafe ( ) const
Returns
true if the access to pbo is blocking.
Version
1.3
virtual 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 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 bool 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
sizetotal number of bytes (not 0)
typethe access type: GL_READ_ONLY_ARB or GL_WRITE_ONLY_ARB
Returns
true on success, false otherwise
Version
1.3
virtual void eq::util::PixelBufferObject::unbind ( ) const
virtual

Unbind the PBO.

Version
1.3
virtual 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: