glfw: macOS cross compilation with automatic setup

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2021-07-10 01:01:51 -07:00
parent 91be49b733
commit bba27cf1aa
2 changed files with 61 additions and 13 deletions

View file

@ -8,14 +8,13 @@ pub fn basicTest() void {
@panic("failed to init");
}
const window = c.glfwCreateWindow(640, 480, "GLFW example", null, null);
if (window == null)
{
if (window == null) {
c.glfwTerminate();
@panic("failed to create window");
}
var start = std.time.milliTimestamp();
while (std.time.milliTimestamp() < start+3000 and c.glfwWindowShouldClose(window) != c.GLFW_TRUE) {
while (std.time.milliTimestamp() < start + 3000 and c.glfwWindowShouldClose(window) != c.GLFW_TRUE) {
c.glfwPollEvents();
}