#include "Quad.hh" #include #include Quad::Quad(std::span verts, const Uniform &uniform_data) : m_mesh(verts) { m_uniform_data.rotation = uniform_data.rotation; m_uniform_data.world_pos = uniform_data.world_pos; } glm::vec2 Quad::get_position_vector() { return glm::vec2(m_pos_x, m_pos_y); } void Quad::draw(){ float time = glfwGetTime(); m_rotation = 2*sin(time); m_pos_x = 0.25*sin(time); m_pos_y = 0.5*cos(time); glUniform2f(m_uniform_data.world_pos, m_pos_x, m_pos_y); glUniform1f(m_uniform_data.rotation, m_rotation); m_mesh.bindVAO(); glDrawArrays(GL_TRIANGLES, 0, 6); }