Inviwo  0.9.10.1
Inviwo documentation
inviwo::BufferGL Class Reference
+ Inheritance diagram for inviwo::BufferGL:

Public Member Functions

 BufferGL (size_t size, const DataFormatBase *format, BufferUsage usage, BufferTarget target, std::shared_ptr< BufferObject > data=std::shared_ptr< BufferObject >(nullptr))
 Create a buffer stored on the GPU. More...
 
 BufferGL (const BufferGL &rhs)
 
virtual BufferGLclone () const override
 
virtual void setSize (size_t size) override
 
virtual size_t getSize () const override
 
GLenum getFormatType () const
 
GLuint getId () const
 
virtual std::shared_ptr< BufferObjectgetBufferObject () const
 
void bind () const
 
void upload (const void *data, GLsizeiptr sizeInBytes)
 
void download (void *data) const
 
void enable () const
 
void disable () const
 
virtual std::type_index getTypeIndex () const override final
 
- Public Member Functions inherited from inviwo::BufferRepresentation
virtual size_t getSizeOfElement () const
 
BufferUsage getBufferUsage () const
 
BufferTarget getBufferTarget () const
 
- Public Member Functions inherited from inviwo::DataRepresentation< BufferBase >
const DataFormatBasegetDataFormat () const
 
std::string getDataFormatString () const
 
DataFormatId getDataFormatId () const
 
void setOwner (BufferBase *owner)
 
BufferBasegetOwner ()
 
const BufferBasegetOwner () const
 
bool isValid () const
 
void setValid (bool valid)
 

Protected Attributes

std::shared_ptr< BufferObjectbuffer_
 
std::unique_ptr< BufferObjectArraybufferArray_
 
size_t size_
 
- Protected Attributes inherited from inviwo::BufferRepresentation
BufferUsage usage_
 
BufferTarget target_
 
- Protected Attributes inherited from inviwo::DataRepresentation< BufferBase >
bool isValid_
 
const DataFormatBasedataFormatBase_
 
BufferBaseowner_
 

Additional Inherited Members

- Public Types inherited from inviwo::DataRepresentation< BufferBase >
using ReprOwner = BufferBase
 
- Protected Member Functions inherited from inviwo::BufferRepresentation
 BufferRepresentation (const DataFormatBase *format, BufferUsage usage=BufferUsage::Static, BufferTarget target=BufferTarget::Data)
 
 BufferRepresentation (const BufferRepresentation &rhs)=default
 
BufferRepresentationoperator= (const BufferRepresentation &that)=default
 
- Protected Member Functions inherited from inviwo::DataRepresentation< BufferBase >
 DataRepresentation (const DataFormatBase *format)
 
 DataRepresentation (const DataRepresentation &rhs)=default
 
DataRepresentationoperator= (const DataRepresentation &that)=default
 
void setDataFormat (const DataFormatBase *format)
 

Constructor & Destructor Documentation

◆ BufferGL()

inviwo::BufferGL::BufferGL ( size_t  size,
const DataFormatBase format,
BufferUsage  usage,
BufferTarget  target,
std::shared_ptr< BufferObject data = std::shared_ptr<BufferObject>(nullptr) 
)

Create a buffer stored on the GPU.

Parameters
sizeSize in bytes.
formatData format
usageBufferUsage::Static if not changing all the time, else BufferUsage::Dynamic.
targetBufferTarget::Data for vertex buffers and BufferTarget::Index for index buffers
dataWill be created if nullptr.
Returns

Member Function Documentation

◆ getSize()

size_t inviwo::BufferGL::getSize ( ) const
overridevirtual

Return the number of elements in the buffer.

Implements inviwo::BufferRepresentation.


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