text: #include <Engine/Mesh.h>
  
  Mesh::Mesh() : m_VAO(0), m_VBO(0), m_EBO(0)
  {
  
  }
  
  Mesh::Mesh(std::vector<float>& vertices, std::vector<GLuint>& indices) : m_VAO(0), m_VBO(0), m_EBO(0)
  {
  	m_vertices = vertices;
  	m_indices = indices;
  
  	glGenVertexArrays(1, &m_VAO);
  	glGenBuffers(1, &m_VBO);
  	glGenBuffers(1, &m_EBO);
  	// bind the Vertex Array Object first, then bind and set vertex buffer(s), and then configure vertex attributes(s).
  	glBindVertexArray(m_VAO);
  
  	glBindBuffer(GL_ARRAY_BUFFER, m_VBO);
  	glBufferData(GL_ARRAY_BUFFER, sizeof(float) * vertices.size(), &vertices[0], GL_STATIC_DRAW);
  
  	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_EBO);
  	glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned int) * indices.size(), &indices[0], GL_STATIC_DRAW);
  
  	glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 8 * sizeof(float), (void*)0);
  	glEnableVertexAttribArray(0);
  
  	glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 8 * sizeof(float), (void*)(3 * sizeof(float)));
  	glEnableVertexAttribArray(1);
  
  	glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, 8 * sizeof(float), (void*)(6 * sizeof(float)));
  	glEnableVertexAttribArray(2);
  
  	glBindBuffer(GL_ARRAY_BUFFER, 0);
  
  	glBindVertexArray(0);
  }
  
  void Mesh::Use()
  {
  	glBindVertexArray(m_VAO);
  }