mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-28 02:58:35 +02:00
+ | FPS ~ | Single triangle shader
This commit is contained in:
@ -85,9 +85,15 @@ void Window::mouseButtonCallback(GLFWwindow* window, int button, int action, int
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Window::display()
|
||||
{
|
||||
static double lastTime = glfwGetTime();
|
||||
double currentTime = glfwGetTime();
|
||||
double delta = currentTime - lastTime;
|
||||
|
||||
lastTime = currentTime;
|
||||
_fps = 1.0f / delta;
|
||||
|
||||
glfwSwapBuffers(_window);
|
||||
}
|
||||
void Window::pollEvents()
|
||||
@ -107,3 +113,8 @@ RT::Vec2i Window::getMousePos(void) const
|
||||
{
|
||||
return (_mousePos);
|
||||
}
|
||||
|
||||
float Window::getFps(void) const
|
||||
{
|
||||
return (_fps);
|
||||
}
|
Reference in New Issue
Block a user