Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
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.
 BufferGL (const BufferGL &rhs)
virtual BufferGLclone () const override
virtual const DataFormatBasegetDataFormat () const override
virtual void setSize (size_t size) override
 set the size of the buffer Note that the internal BufferObject is only growing in size and never shrinking to avoid unnecessary reallocations in GPU memory.
virtual size_t getSize () const override
GLenum getFormatType () const
GLuint getId () const
virtual std::shared_ptr< BufferObjectgetBufferObject () const
void bind () const
void unbind () 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
std::string_view getDataFormatString () const
DataFormatId getDataFormatId () const
virtual size_t getSizeOfElement () const
BufferUsage getBufferUsage () const
BufferTarget getBufferTarget () const
Public Member Functions inherited from inviwo::DataRepresentation< BufferBase >
void setOwner (const BufferBase *owner)
const BufferBasegetOwner () const
bool isValid () const
void setValid (bool valid)
virtual void updateResource (const ResourceMeta &) const

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 BufferBaseowner_

Additional Inherited Members

Public Types inherited from inviwo::DataRepresentation< BufferBase >
using ReprOwner
Protected Member Functions inherited from inviwo::BufferRepresentation
 BufferRepresentation (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 >
DataRepresentationoperator= (const DataRepresentation &that)=default

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.

Member Function Documentation

◆ clone()

virtual BufferGL * inviwo::BufferGL::clone ( ) const
overridevirtual

◆ getDataFormat()

virtual const DataFormatBase * inviwo::BufferGL::getDataFormat ( ) const
overridevirtual

◆ getSize()

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

Return the number of elements in the buffer.

Implements inviwo::BufferRepresentation.

◆ getTypeIndex()

virtual std::type_index inviwo::BufferGL::getTypeIndex ( ) const
finaloverridevirtual

◆ setSize()

virtual void inviwo::BufferGL::setSize ( size_t size)
overridevirtual

set the size of the buffer Note that the internal BufferObject is only growing in size and never shrinking to avoid unnecessary reallocations in GPU memory.

Implements inviwo::BufferRepresentation.


The documentation for this class was generated from the following file:
  • buffergl.h