hx3d
1
2D/3D Simple Game Framework
|
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... | |
AttributeArrayBuffer & | getAttribute (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... | |
![]() | |
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 | |
![]() | |
std::vector< float > | _vector |
Data. | |
GLuint | _buf |
Internal ID. | |
Multi-component array buffer for optimization purpose.
Definition at line 41 of file multi_array_buffer.hpp.
void hx3d::graphics::buffers::MultiArrayBuffer::addAttribute | ( | const std::string | name, |
const Attribute | attribute | ||
) |
Add an empty initialized attribute array buffer.
name | Name |
attribute | Attribute |
Definition at line 39 of file multi_array_buffer.cpp.
|
overridevirtual |
Begin the use with a shader.
shader | Shader (Ptr) |
Implements hx3d::graphics::buffers::ArrayBuffer< float >.
Definition at line 87 of file multi_array_buffer.cpp.
End the use with a shader.
shader | Shader (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.
name | Attribute name |
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.
name | Attribute name |
data | Values |
Definition at line 49 of file multi_array_buffer.cpp.