8 const float* _positions_Ptr,
9 const unsigned int _pos_size,
10 const float* _normals_Ptr,
11 const unsigned int _norm_size,
12 const unsigned int* _index_Ptr,
13 const unsigned int _ind_size)
14 :
DrawableObject(_modelMatrix), shader_Ptr(_shader), index_count(_ind_size)
20 glBufferData(GL_ARRAY_BUFFER, _pos_size * 3 *
sizeof(
float), _positions_Ptr, GL_STATIC_DRAW);
21 glBindBuffer(GL_ARRAY_BUFFER,0);
26 glBufferData(GL_ARRAY_BUFFER, _norm_size * 3 *
sizeof(
float), _normals_Ptr, GL_STATIC_DRAW);
27 glBindBuffer(GL_ARRAY_BUFFER,0);
32 glBufferData(GL_ELEMENT_ARRAY_BUFFER, _ind_size *
sizeof(
unsigned int), _index_Ptr, GL_STATIC_DRAW);
33 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,0);
43 glEnableVertexAttribArray(shader_in_position_handle);
44 glVertexAttribPointer(shader_in_position_handle, 3, GL_FLOAT, GL_FALSE, 0, 0);
49 glEnableVertexAttribArray(shader_in_normal_handle);
50 glVertexAttribPointer(shader_in_normal_handle, 3, GL_FLOAT, GL_FALSE, 0, 0);
57 glBindBuffer(GL_ARRAY_BUFFER, 0);
58 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
79 glm::value_ptr(_projectionMatrix));
83 glm::value_ptr(this->modelMatrix));
88 glDrawElements(GL_TRIANGLES, this->
index_count, GL_UNSIGNED_INT,0);