| 49 | } |
| 50 | |
| 51 | void Model::addData(const std::vector<GLfloat>& vertexPositions, |
| 52 | const std::vector<GLfloat>& textureCoordinates, |
| 53 | const std::vector<GLuint>& indices) |
| 54 | { |
| 55 | deleteData(); |
| 56 | |
| 57 | m_indicesCount = indices.size(); |
| 58 | glGenVertexArrays(1, &m_vao); |
| 59 | glBindVertexArray(m_vao); |
| 60 | |
| 61 | addVBO(3, vertexPositions); |
| 62 | addVBO(2, textureCoordinates); |
| 63 | addEBO(indices); |
| 64 | } |
| 65 | |
| 66 | void Model::deleteData() |
| 67 | { |