#include "asset/object/model.h"

namespace veng {

Model::Model(std::shared_ptr<Graphics> graphics) { graphics_ = graphics; }

Model::~Model() {
  auto graphics = graphics_.lock();

  if (!graphics) return;

  graphics->DestroyTexture(material.texture);
  graphics->DestroyBuffer(vertex_buffer);
  graphics->DestroyBuffer(index_buffer);
}

}  // namespace veng
