Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | List of all members
om::graphics::devices::opengl::OpenGLBuffer Class Reference

A class that represents a buffer of vertex attributes stored in GPU memory. More...

#include <omGraphicsOpenGLBuffer.h>

Inheritance diagram for om::graphics::devices::opengl::OpenGLBuffer:
om::graphics::buffers::DeviceBuffer om::graphics::devices::DeviceResource

Public Member Functions

 ~OpenGLBuffer ()
 Destroy this vertex buffer and all state associated with it. More...
 
virtual BufferUsage getUsage () const
 Return the current expected usage pattern for this hardware attribute buffer. More...
 
virtual Size getCapacity () const
 Return the number of bytes that this buffer is able to hold. More...
 
virtual Bool setCapacity (Size newCapacityInBytes)
 Set the number of bytes that this buffer is able to hold. More...
 
virtual Bool setCapacity (Size newCapacityInBytes, BufferUsage newUsage)
 Set the number of bytes that this buffer is able to hold. More...
 
virtual Bool reallocate ()
 Reallocate this buffer's data store using its current capacity. More...
 
virtual Bool reallocate (BufferUsage newUsage)
 Reallocate this buffer's data store using its current capacity, changing its usage type. More...
 
virtual Bool getData (void *data, Size &numBytes) const
 Read the specified number of bytes from the buffer into the output data pointer. More...
 
virtual Bool setData (const void *data, Size numBytes, BufferUsage newUsage=BufferUsage::STATIC)
 Replace the contents of this buffer with the specified data. More...
 
virtual Bool updateData (const void *data, Size numBytes, Index startIndex=0)
 Update a region of this buffer with the specified data. More...
 
virtual void * map (BufferAccessType accessType)
 Map this buffer's data store to the main memory address space and return a pointer to it. More...
 
virtual void * mapRange (BufferAccessType accessType, Index byteOffset, Size numBytes)
 Map this buffer's data store to the main memory address space and return a pointer to it. More...
 
virtual void unmap () const
 Unmap this buffer's data store from the main memory address space. More...
 
virtual Bool isMapped () const
 Return whether or not this attribute buffer is currently mapped to main memory. More...
 
virtual Bool isValid () const
 Return whether or not the state of this buffer is valid and able to be used for rendering. More...
 
OpenGLID getID () const
 Get a unique integral identifier for this vertex buffer. More...
 
- Public Member Functions inherited from om::graphics::buffers::DeviceBuffer
const BufferTypegetType () const
 Return the type of attribute buffer that this device buffer represents. More...
 
- Public Member Functions inherited from om::graphics::devices::DeviceResource
virtual ~DeviceResource ()
 Destroy a device object, releasing all internal state. More...
 
GraphicsContextgetContext () const
 Return a pointer to the graphics context associated with this DeviceResource. More...
 

Additional Inherited Members

- Protected Member Functions inherited from om::graphics::buffers::DeviceBuffer
 DeviceBuffer (devices::GraphicsContext *newContext, BufferType newBufferType)
 Create a device attribute buffer for the specified context with the given buffer type. More...
 
- Protected Member Functions inherited from om::graphics::devices::DeviceResource
 DeviceResource (GraphicsContext *newContext)
 Create a new device object that is associated with the specified graphics context. More...
 
- Protected Attributes inherited from om::graphics::buffers::DeviceBuffer
BufferType bufferType
 An enum value that is set by subclasses that specifies the kind of attribute buffer this is. More...
 

Detailed Description

A class that represents a buffer of vertex attributes stored in GPU memory.

This class allows attribute data to be stored in the graphics card's RAM for faster access. It is analogous to the Texture class that performs the same function but for pixel data.

Constructor & Destructor Documentation

om::graphics::devices::opengl::OpenGLBuffer::~OpenGLBuffer ( )

Destroy this vertex buffer and all state associated with it.

Member Function Documentation

virtual BufferUsage om::graphics::devices::opengl::OpenGLBuffer::getUsage ( ) const
virtual

Return the current expected usage pattern for this hardware attribute buffer.

Implements om::graphics::buffers::DeviceBuffer.

virtual Size om::graphics::devices::opengl::OpenGLBuffer::getCapacity ( ) const
virtual

Return the number of bytes that this buffer is able to hold.

Implements om::graphics::buffers::DeviceBuffer.

virtual Bool om::graphics::devices::opengl::OpenGLBuffer::setCapacity ( Size  newCapacityInBytes)
virtual

Set the number of bytes that this buffer is able to hold.

Implements om::graphics::buffers::DeviceBuffer.

virtual Bool om::graphics::devices::opengl::OpenGLBuffer::setCapacity ( Size  newCapacityInBytes,
BufferUsage  newUsage 
)
virtual

Set the number of bytes that this buffer is able to hold.

Implements om::graphics::buffers::DeviceBuffer.

virtual Bool om::graphics::devices::opengl::OpenGLBuffer::reallocate ( )
virtual

Reallocate this buffer's data store using its current capacity.

Implements om::graphics::buffers::DeviceBuffer.

virtual Bool om::graphics::devices::opengl::OpenGLBuffer::reallocate ( BufferUsage  newUsage)
virtual

Reallocate this buffer's data store using its current capacity, changing its usage type.

Implements om::graphics::buffers::DeviceBuffer.

virtual Bool om::graphics::devices::opengl::OpenGLBuffer::getData ( void *  data,
Size numBytes 
) const
virtual

Read the specified number of bytes from the buffer into the output data pointer.

Implements om::graphics::buffers::DeviceBuffer.

virtual Bool om::graphics::devices::opengl::OpenGLBuffer::setData ( const void *  data,
Size  numBytes,
BufferUsage  newUsage = BufferUsage::STATIC 
)
virtual

Replace the contents of this buffer with the specified data.

Implements om::graphics::buffers::DeviceBuffer.

virtual Bool om::graphics::devices::opengl::OpenGLBuffer::updateData ( const void *  data,
Size  numBytes,
Index  startIndex = 0 
)
virtual

Update a region of this buffer with the specified data.

Implements om::graphics::buffers::DeviceBuffer.

virtual void* om::graphics::devices::opengl::OpenGLBuffer::map ( BufferAccessType  accessType)
virtual

Map this buffer's data store to the main memory address space and return a pointer to it.

Implements om::graphics::buffers::DeviceBuffer.

virtual void* om::graphics::devices::opengl::OpenGLBuffer::mapRange ( BufferAccessType  accessType,
Index  byteOffset,
Size  numBytes 
)
virtual

Map this buffer's data store to the main memory address space and return a pointer to it.

Implements om::graphics::buffers::DeviceBuffer.

virtual void om::graphics::devices::opengl::OpenGLBuffer::unmap ( ) const
virtual

Unmap this buffer's data store from the main memory address space.

Implements om::graphics::buffers::DeviceBuffer.

virtual Bool om::graphics::devices::opengl::OpenGLBuffer::isMapped ( ) const
virtual

Return whether or not this attribute buffer is currently mapped to main memory.

Implements om::graphics::buffers::DeviceBuffer.

virtual Bool om::graphics::devices::opengl::OpenGLBuffer::isValid ( ) const
virtual

Return whether or not the state of this buffer is valid and able to be used for rendering.

Implements om::graphics::devices::DeviceResource.

OpenGLID om::graphics::devices::opengl::OpenGLBuffer::getID ( ) const
inline

Get a unique integral identifier for this vertex buffer.


The documentation for this class was generated from the following file: