glfw: add Window.shouldClose

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2021-07-18 21:57:46 -07:00
parent badc8939b5
commit a9446f4ed6
2 changed files with 19 additions and 1 deletions

View file

@ -133,7 +133,7 @@ pub fn basicTest() !void {
defer window.destroy();
var start = std.time.milliTimestamp();
while (std.time.milliTimestamp() < start + 1000 and c.glfwWindowShouldClose(window.handle) != c.GLFW_TRUE) {
while (std.time.milliTimestamp() < start + 1000 and !window.shouldClose()) {
c.glfwPollEvents();
}
}