add framerate limiter

This commit is contained in:
Robert 2023-01-29 17:42:46 +01:00
parent 9ce2fa6124
commit e9264127c5
7 changed files with 73 additions and 0 deletions

View file

@ -11,6 +11,7 @@ Window::Window(uint16_t width, uint16_t height, const std::string& title) :
handle(nullptr)
{
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
handle = glfwCreateWindow(width, height, title.c_str(), nullptr, nullptr);
if (handle == nullptr)
{
@ -20,6 +21,7 @@ Window::Window(uint16_t width, uint16_t height, const std::string& title) :
}
glfwMakeContextCurrent(handle);
glfwSwapInterval(1);
Input::SetWindow(this);
}