Added Time
This commit is contained in:
8
TSE_GlfwImpl/src/TimeInterfaceGlfw.cpp
Normal file
8
TSE_GlfwImpl/src/TimeInterfaceGlfw.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "TimeInterfaceGlfw.hpp"
|
||||
|
||||
#include "GLFW/glfw3.h"
|
||||
|
||||
float TSE::GLFW::TimeInterfaceGlfw::GetTotalEllapsedTime()
|
||||
{
|
||||
return (float)glfwGetTime();
|
||||
}
|
||||
12
TSE_GlfwImpl/src/TimeInterfaceGlfw.hpp
Normal file
12
TSE_GlfwImpl/src/TimeInterfaceGlfw.hpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "interfaces/ITimeInterface.hpp"
|
||||
|
||||
namespace TSE::GLFW
|
||||
{
|
||||
class TimeInterfaceGlfw : public ITimeInterface
|
||||
{
|
||||
public:
|
||||
float GetTotalEllapsedTime() override;
|
||||
};
|
||||
} // namespace TSE::GLFW
|
||||
@@ -1,4 +1,6 @@
|
||||
#include "WindowGlfw.hpp"
|
||||
#include "utils/Time.hpp"
|
||||
#include "TimeInterfaceGlfw.hpp"
|
||||
#include "Debug.hpp"
|
||||
|
||||
TSE::GLFW::WindowGlfw::WindowGlfw(string _title, int _width, int _height, IRenderingBackend* backend)
|
||||
@@ -36,6 +38,8 @@ bool TSE::GLFW::WindowGlfw::Init()
|
||||
return false;
|
||||
}
|
||||
|
||||
Time::Init(new TimeInterfaceGlfw());
|
||||
|
||||
renderingBackend->InitPreWindow();
|
||||
glfwWindowHint(GLFW_FOCUSED, true);
|
||||
|
||||
@@ -118,6 +122,7 @@ void TSE::GLFW::WindowGlfw::Clear() const
|
||||
|
||||
void TSE::GLFW::WindowGlfw::Update() const
|
||||
{
|
||||
BaseUpdate();
|
||||
glfwPollEvents();
|
||||
|
||||
renderingBackend->onUpdate();
|
||||
|
||||
Reference in New Issue
Block a user