hx3d  1
2D/3D Simple Game Framework
Public Member Functions | List of all members
hx3d::graphics::buffers::MultiArrayBuffer Class Reference

Multi-component array buffer for optimization purpose. More...

#include <multi_array_buffer.hpp>

Public Member Functions

void addAttribute (const std::string name, const Attribute attribute)
 Add an empty initialized attribute array buffer. More...
 
void setAttribute (const std::string name, const std::vector< float > data)
 Set the wanted attribute array buffer content. More...
 
AttributeArrayBuffergetAttribute (const std::string name)
 Get the wanted attribute array buffer. More...
 
void generate ()
 Generate the vector using the attributes.
 
virtual void upload () override
 Upload the data to the GPU.
 
virtual void begin (const Ptr< Shader > &shader) override
 Begin the use with a shader. More...
 
virtual void end (const Ptr< Shader > &shader) override
 End the use with a shader. More...
 
- Public Member Functions inherited from hx3d::graphics::buffers::Buffer< float >
void set (const std::vector< float > &values)
 Set the buffer values. More...
 
void add (const std::vector< float > &values)
 Add buffer values. More...
 
float * data ()
 Get the buffer values. More...
 
GLuint getId ()
 Get the buffer ID. More...
 
unsigned int size ()
 Get the buffer size. More...
 
std::vector< float > & getVector ()
 Get the vector. More...
 
float getValue (unsigned int i)
 Get a value. More...
 
void setValue (const unsigned int i, const floatvalue)
 Set a value. More...
 
void clear ()
 Clear all values.
 

Additional Inherited Members

- Protected Attributes inherited from hx3d::graphics::buffers::Buffer< float >
std::vector< float > _vector
 Data.
 
GLuint _buf
 Internal ID.
 

Detailed Description

Multi-component array buffer for optimization purpose.

Definition at line 41 of file multi_array_buffer.hpp.

Member Function Documentation

void hx3d::graphics::buffers::MultiArrayBuffer::addAttribute ( const std::string  name,
const Attribute  attribute 
)

Add an empty initialized attribute array buffer.

Parameters
nameName
attributeAttribute

Definition at line 39 of file multi_array_buffer.cpp.

void hx3d::graphics::buffers::MultiArrayBuffer::begin ( const Ptr< Shader > &  shader)
overridevirtual

Begin the use with a shader.

Parameters
shaderShader (Ptr)

Implements hx3d::graphics::buffers::ArrayBuffer< float >.

Definition at line 87 of file multi_array_buffer.cpp.

void hx3d::graphics::buffers::MultiArrayBuffer::end ( const Ptr< Shader > &  shader)
overridevirtual

End the use with a shader.

Parameters
shaderShader (Ptr)

Implements hx3d::graphics::buffers::ArrayBuffer< float >.

Definition at line 103 of file multi_array_buffer.cpp.

AttributeArrayBuffer & hx3d::graphics::buffers::MultiArrayBuffer::getAttribute ( const std::string  name)

Get the wanted attribute array buffer.

Parameters
nameAttribute name
Returns
Attribute array buffer

Definition at line 55 of file multi_array_buffer.cpp.

void hx3d::graphics::buffers::MultiArrayBuffer::setAttribute ( const std::string  name,
const std::vector< float >  data 
)

Set the wanted attribute array buffer content.

Parameters
nameAttribute name
dataValues

Definition at line 49 of file multi_array_buffer.cpp.


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