#ifndef Graphics_hpp
#define Graphics_hpp

#include <math/Matrix.hpp>
#include <input/Input.hpp>
#include "Color.hpp"

struct Graphics : Input {
  static Graphics* get();
  const double Near = 0.1;
  const double R;
  Color textColor;
  Graphics& loop();
  Graphics& push();
  Graphics& apply(const Matrix& m);
  Graphics& pop();
  virtual Graphics& render();
  Graphics(
    const char* name,
    const double R,
    const Color& color
  );
  virtual ~Graphics();
protected:
  unsigned int frames = 0;
  Graphics& setView(
    const Vector& from,
    const Vector& to = Vector::Zero,
    const Vector& up = Vector::Y
  );
  const Graphics& setText(const char* text = nullptr) const;
  virtual Graphics& onLoop();
private:
  const std::string name;
};

#endif
