diff options
| author | s-ol <s+removethis@s-ol.nu> | 2025-09-22 15:31:11 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2025-09-22 15:31:11 +0000 |
| commit | 445c01c7862c69e439d8695c63ff2ef0b90c75c4 (patch) | |
| tree | 93b5df50285bec588d520d8456573e114abd8c02 /src/gl.zig | |
| parent | update for Zig 0.15.1 (diff) | |
| download | glsl-view-445c01c7862c69e439d8695c63ff2ef0b90c75c4.tar.gz glsl-view-445c01c7862c69e439d8695c63ff2ef0b90c75c4.zip | |
log errors in threads
Diffstat (limited to 'src/gl.zig')
| -rw-r--r-- | src/gl.zig | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -902,17 +902,18 @@ pub const Thread = struct { return thread; } - pub const InitFn = fn (*Thread, *const Constants, anytype) anyerror!void; + pub const InitFn = fn (*Thread, *const Constants, anytype) void; fn runner(comptime f: anytype) InitFn { - const ReturnType = @typeInfo(@TypeOf(f)).@"fn".return_type.?; const Impl = struct { - pub fn init(self: *Thread, constants: *const Constants, args: anytype) ReturnType { + pub fn init(self: *Thread, constants: *const Constants, args: anytype) void { c.glfwWindowHint(c.GLFW_VISIBLE, c.GLFW_FALSE); self.window = c.glfwCreateWindow(200, 200, "glsl-view Thread", null, constants.main_window) orelse unreachable; c.glfwMakeContextCurrent(self.window); - return @call(.auto, f, args); + @call(.auto, f, args) catch |err| { + std.debug.print("Error in thread: {}\n", .{err}); + }; } }; |
