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

Attribute specialized array buffer. More...

#include <attribute_array_buffer.hpp>

Public Member Functions

 AttributeArrayBuffer ()
 Construct an empty attribute array buffer. More...
 
 AttributeArrayBuffer (const Attribute attribute)
 Construct an empty but initialized attribute array buffer. More...
 
 AttributeArrayBuffer (const Attribute attribute, const std::vector< float > values)
 Construct an initialized attribute array buffer with values. More...
 
void create (const Attribute attribute)
 Initialize the attribute array buffer. More...
 
AttributegetAttribute ()
 Get the attribute. More...
 
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.
 

Protected Attributes

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

Detailed Description

Attribute specialized array buffer.

Definition at line 34 of file attribute_array_buffer.hpp.

Constructor & Destructor Documentation

hx3d::graphics::buffers::AttributeArrayBuffer::AttributeArrayBuffer ( )

Construct an empty attribute array buffer.

See create to initialize it.

Definition at line 29 of file attribute_array_buffer.cpp.

hx3d::graphics::buffers::AttributeArrayBuffer::AttributeArrayBuffer ( const Attribute  attribute)

Construct an empty but initialized attribute array buffer.

Parameters
attributeAttribute

Definition at line 33 of file attribute_array_buffer.cpp.

hx3d::graphics::buffers::AttributeArrayBuffer::AttributeArrayBuffer ( const Attribute  attribute,
const std::vector< float >  values 
)

Construct an initialized attribute array buffer with values.

Parameters
attributeAttribute
valuesValues

Definition at line 37 of file attribute_array_buffer.cpp.

Member Function Documentation

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

Begin the use with a shader.

Parameters
shaderShader (Ptr)

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

Definition at line 62 of file attribute_array_buffer.cpp.

void hx3d::graphics::buffers::AttributeArrayBuffer::create ( const Attribute  attribute)

Initialize the attribute array buffer.

Parameters
attributeAttribute

Definition at line 45 of file attribute_array_buffer.cpp.

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

End the use with a shader.

Parameters
shaderShader (Ptr)

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

Definition at line 75 of file attribute_array_buffer.cpp.

Attribute & hx3d::graphics::buffers::AttributeArrayBuffer::getAttribute ( )

Get the attribute.

Returns
Attribute

Definition at line 49 of file attribute_array_buffer.cpp.


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