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

Attribute specialized streamed array buffer. More...

#include <attribute_stream_buffer.hpp>

Public Member Functions

 AttributeStreamBuffer ()
 Construct an empty attribute array buffer. More...
 
 AttributeStreamBuffer (const Attribute attribute, const unsigned int stream_size)
 Construct an empty but initialized attribute array buffer. More...
 
void create (const Attribute attribute, const unsigned int stream_size)
 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.
 
unsigned int _stream_size
 Stream size.
 
- Protected Attributes inherited from hx3d::graphics::buffers::Buffer< float >
std::vector< float > _vector
 Data.
 
GLuint _buf
 Internal ID.
 

Detailed Description

Attribute specialized streamed array buffer.

Definition at line 34 of file attribute_stream_buffer.hpp.

Constructor & Destructor Documentation

hx3d::graphics::buffers::AttributeStreamBuffer::AttributeStreamBuffer ( )

Construct an empty attribute array buffer.

See create to initialize it.

Definition at line 29 of file attribute_stream_buffer.cpp.

hx3d::graphics::buffers::AttributeStreamBuffer::AttributeStreamBuffer ( const Attribute  attribute,
const unsigned int  stream_size 
)

Construct an empty but initialized attribute array buffer.

Parameters
attributeAttribute
stream_sizeStream size

Definition at line 33 of file attribute_stream_buffer.cpp.

Member Function Documentation

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

Begin the use with a shader.

Parameters
shaderShader (Ptr)

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

Definition at line 61 of file attribute_stream_buffer.cpp.

void hx3d::graphics::buffers::AttributeStreamBuffer::create ( const Attribute  attribute,
const unsigned int  stream_size 
)

Initialize the attribute array buffer.

Parameters
attributeAttribute
stream_sizeStream size

Definition at line 39 of file attribute_stream_buffer.cpp.

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

End the use with a shader.

Parameters
shaderShader (Ptr)

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

Definition at line 72 of file attribute_stream_buffer.cpp.

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

Get the attribute.

Returns
Attribute

Definition at line 44 of file attribute_stream_buffer.cpp.


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