10#ifndef OGL_VERTEX_ARRAY_HEADER
11#define OGL_VERTEX_ARRAY_HEADER
37 typedef std::shared_ptr<VertexArray>
Ptr;
38 typedef std::shared_ptr<VertexArray const>
ConstPtr;
40 typedef std::pair<VertexBuffer::Ptr, std::string>
BoundVBO;
45 static Ptr create (
void);
48 void set_primitive (GLuint primitive);
63 void remove_vbo (std::string
const& name);
66 void reset_vertex_array (
void);
73 void assign_attrib (
BoundVBO const& bound_vbo);
89VertexArray::VertexArray (
void)
91 glGenVertexArrays(1, &this->vao_id);
93 this->primitive = GL_TRIANGLES;
97VertexArray::~VertexArray (
void)
99 glDeleteVertexArrays(1, &this->vao_id);
104VertexArray::create (
void)
110VertexArray::set_primitive (GLuint primitive)
112 this->primitive = primitive;
118 this->vert_vbo = vbo;
124 this->index_vbo = vbo;
130 this->vbo_list.push_back(std::make_pair(vbo, name));
134VertexArray::reset_vertex_array(
void)
136 this->vert_vbo.reset();
137 this->index_vbo.reset();
138 this->vbo_list.clear();
140 glDeleteVertexArrays(1, &this->vao_id);
142 glGenVertexArrays(1, &this->vao_id);
149 this->shader = shader;
std::shared_ptr< ShaderProgram > Ptr
OpenGL vertex array object abstraction.
std::pair< VertexBuffer::Ptr, std::string > BoundVBO
std::shared_ptr< VertexArray > Ptr
std::shared_ptr< VertexArray const > ConstPtr
std::vector< BoundVBO > VBOList
std::shared_ptr< VertexBuffer > Ptr
#define OGL_NAMESPACE_END
#define OGL_NAMESPACE_BEGIN