21 #include "hx3d/graphics/buffers/attribute_stream_buffer.hpp" 23 #include "hx3d/graphics/shader.hpp" 37 AttributeStreamBuffer::~AttributeStreamBuffer() {}
56 glBindBuffer(GL_ARRAY_BUFFER,
_buf);
58 glBindBuffer(GL_ARRAY_BUFFER, 0);
65 glBindBuffer(GL_ARRAY_BUFFER,
_buf);
66 glEnableVertexAttribArray(loc);
69 glBindBuffer(GL_ARRAY_BUFFER, 0);
76 glDisableVertexAttribArray(loc);
virtual void upload() override
Upload the data to the GPU.
std::vector< float > _vector
Data.
AttributeStreamBuffer()
Construct an empty attribute array buffer.
const GLenum getType() const
Get the attribute type.
Attribute & getAttribute()
Get the attribute.
virtual void begin(const Ptr< Shader > &shader) override
Begin the use with a shader.
void create(const Attribute attribute, const unsigned int stream_size)
Initialize the attribute array buffer.
const GLuint getSize() const
Get the attribute size.
virtual void end(const Ptr< Shader > &shader) override
End the use with a shader.
const std::string getName() const
Get the attribute name.
unsigned int _stream_size
Stream size.
Attribute _attribute
Attribute.
std::shared_ptr< T > Ptr
Quick-typing shared ptr.
OpenGL GPU uploadable buffer.