various fixes for macos

This commit is contained in:
Mitchell Hashimoto
2022-04-24 10:14:25 -07:00
parent 747ebfb628
commit 724b2aedfa
3 changed files with 9 additions and 7 deletions

View File

@@ -6,6 +6,7 @@
const Window = @This();
const std = @import("std");
const builtin = @import("builtin");
const assert = std.debug.assert;
const Allocator = std.mem.Allocator;
const Grid = @import("Grid.zig");
@@ -55,6 +56,7 @@ pub fn create(alloc: Allocator, loop: libuv.Loop) !*Window {
.context_version_minor = 3,
.opengl_profile = .opengl_core_profile,
.opengl_forward_compat = true,
.cocoa_graphics_switching = builtin.os.tag == .macos,
});
errdefer window.destroy();

View File

@@ -105,7 +105,7 @@ fn threadMain(self: *Embed) void {
.macos, .dragonfly, .freebsd, .openbsd, .netbsd => {
var ts: std.os.timespec = .{
.tv_sec = @divTrunc(timeout, 1000),
.tv_nsec = @mod(timeout, 1000) * 1000,
.tv_nsec = @mod(timeout, 1000) * 1000000,
};
var ev: [0]std.os.Kevent = undefined;