#include "Time.h"
#include "GL/glfw.h"

namespace GLUtils
{
	double Time::sLastTime = 0.0f;
	double Time::sFrameTime = 0.033f;

	void Time::Init()
	{
		glfwSetTime(0.0);
	}

	double Time::Update()
	{
		double time = glfwGetTime();
		sFrameTime = time - sLastTime;
		sLastTime = time;

		return sFrameTime;
	}

	double Time::GetDeltaTimeD() { return sFrameTime; }
	float Time::GetDeltaTime() { return sFrameTime; }
}