aboutsummaryrefslogtreecommitdiffstats
path: root/src/gl.zig
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2025-09-22 15:31:11 +0000
committers-ol <s+removethis@s-ol.nu>2025-09-22 15:31:11 +0000
commit445c01c7862c69e439d8695c63ff2ef0b90c75c4 (patch)
tree93b5df50285bec588d520d8456573e114abd8c02 /src/gl.zig
parentupdate for Zig 0.15.1 (diff)
downloadglsl-view-445c01c7862c69e439d8695c63ff2ef0b90c75c4.tar.gz
glsl-view-445c01c7862c69e439d8695c63ff2ef0b90c75c4.zip
log errors in threads
Diffstat (limited to 'src/gl.zig')
-rw-r--r--src/gl.zig9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gl.zig b/src/gl.zig
index bd43b5b..87fc9cb 100644
--- a/src/gl.zig
+++ b/src/gl.zig
@@ -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});
+ };
}
};