#pragma once

#include <glad.h> 
#include <GLFW/glfw3.h> 

namespace VE
{
  template<typename Type = float>
	class timestep
	{
    public:
      timestep(Type data_ = 0.0f) : data { data_ } {}
      operator Type() const { return data; }
      Type get_seconds() const { return data; }
      Type get_milliseconds() const { return data * 1000.0f; }
      
    private:
      Type data;
	};
}

namespace VE 
{
  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;
  }
}

