#include "shape.h" #include #include "Graphics/global.h" #include "Graphics/material.h" #include Shape::Shape(std::shared_ptr vao): m_vao(vao) { } Shape::Shape(std::shared_ptr vao, std::shared_ptr shape_material): m_vao(vao), m_shape_material(shape_material) { hasShapeSpecificMaterial = true; } Shape::~Shape(){ } std::shared_ptr Shape::getShapeMaterial(){ if (hasShapeSpecificMaterial){ return m_shape_material; } std::cout << "this shape does not have material." << std::endl; } bool Shape::hasMaterial(){ return hasShapeSpecificMaterial; } void Shape::draw(){ m_vao->draw(); } void Shape::updateVAO(const std::vector &vertices, const std::vector &faces){ m_vao = Global::graphics.makeVAOFromData(vertices, faces, true, false).second; }