lower framerate when not focused

This commit is contained in:
2024-06-27 22:08:36 -04:00
parent 7f7269fb07
commit 03d9c607c2
2 changed files with 8 additions and 2 deletions

View File

@@ -427,6 +427,10 @@ pub const Window = struct {
pub fn should_close(self: Self) bool {
return c.glfwWindowShouldClose(self.handle) == c.GLFW_TRUE;
}
pub fn focused(self: Self) bool {
return c.glfwGetWindowAttrib(self.handle, c.GLFW_FOCUSED) == c.GLFW_TRUE;
}
};
pub fn wait_events() []const Bus.Event {