void Sprite::Render()
{
glUseProgram(m_Program);
glActiveTexture(GL_TEXTURE0);
// Background
glBindVertexArray(m_BackgroundVAO);
glBindTexture(GL_TEXTURE_2D, m_Textures[1]);
glUniform1i(glGetUniformLocation(m_Program, "Texture1"), 0);
m_ProjectionMatrix = m_Camera.ViewToWorldMatrix();
m_TransformationMatrix = m_ProjectionMatrix;
m_TransformationMatrixLoc = glGetUniformLocation(m_Program, "TransformationMatrix");
glUniformMatrix4fv(m_TransformationMatrixLoc, 1, GL_FALSE, &m_TransformationMatrix[0][0]);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, 0);
// Enemy One
glBindVertexArray(m_EnemyOneVAO);
glBindTexture(GL_TEXTURE_2D, m_Textures[2]);
glUniform1i(glGetUniformLocation(m_Program, "Texture3"), 0);
m_ProjectionMatrix = glm::translate(glm::mat4(), glm::vec3(EnemyOneXCoord, EnemyOneYCoord, 0.0f)) * m_Camera.ViewToWorldMatrix();
m_TransformationMatrix = m_ProjectionMatrix;
m_TransformationMatrixLoc = glGetUniformLocation(m_Program, "TransformationMatrix");
glUniformMatrix4fv(m_TransformationMatrixLoc, 1, GL_FALSE, &m_TransformationMatrix[0][0]);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, 0);
// Platform One
glBindVertexArray(m_PlatformVAO);
glBindTexture(GL_TEXTURE_2D, m_Textures[3]);
glUniform1i(glGetUniformLocation(m_Program, "Texture4"), 0);
m_ProjectionMatrix = glm::translate(glm::mat4(), glm::vec3(0.0f, -0.5f, 0.0f)) * m_Camera.ViewToWorldMatrix();
m_TransformationMatrix = m_ProjectionMatrix;
m_TransformationMatrixLoc = glGetUniformLocation(m_Program, "TransformationMatrix");
glUniformMatrix4fv(m_TransformationMatrixLoc, 1, GL_FALSE, &m_TransformationMatrix[0][0]);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, 0);
// Player
glBindVertexArray(m_PlayerVAO);
glBindTexture(GL_TEXTURE_2D, m_Textures[0]);
glUniform1i(glGetUniformLocation(m_Program, "Texture2"), 0);
m_ProjectionMatrix = glm::translate(glm::mat4(), glm::vec3(PlayerX, PlayerY, 0.0f)) * m_Camera.ViewToWorldMatrix();
m_TransformationMatrix = m_ProjectionMatrix;
m_TransformationMatrixLoc = glGetUniformLocation(m_Program, "TransformationMatrix");
glUniformMatrix4fv(m_TransformationMatrixLoc, 1, GL_FALSE, &m_TransformationMatrix[0][0]);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, 0);
glBindTexture(GL_TEXTURE_2D, 0);
glBindVertexArray(0);
}