#pragma once

#include "using.hpp" // IWYU pragma: keep

namespace VE::time
{
  template<typename Time>
	class timestep
	{
    public:
      timestep(Time data_ = 0.0f) : data { data_ } {}

      operator Time() const { return data; }

      Time get_seconds() const { return data; }
      Time get_milliseconds() const { return data * 1000.0f; }
      
    private:
      Time data;
	};
}

namespace VE::time 
{
  inline timestep<float> get_time()
  {
    static float frame_time = 0.0f;
    float t = (float)glfwGetTime();
    timestep<float> ts = t - frame_time;
    frame_time = t;

    return ts;
  }
}

