aboutsummaryrefslogtreecommitdiffstats
path: root/src/source.zig
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2025-10-19 14:38:49 +0000
committers-ol <s+removethis@s-ol.nu>2025-10-19 14:38:49 +0000
commitbc1e00a5e28cc198981cb59ffe9164b0c62175d1 (patch)
tree31d89ee2c7e363281ed67f770ac2f8760df8c029 /src/source.zig
parentadd toggleable crop mode (diff)
downloadglsl-view-bc1e00a5e28cc198981cb59ffe9164b0c62175d1.tar.gz
glsl-view-bc1e00a5e28cc198981cb59ffe9164b0c62175d1.zip
add BufferedStreamSource
Diffstat (limited to 'src/source.zig')
-rw-r--r--src/source.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/source.zig b/src/source.zig
index 21e82c8..917e08a 100644
--- a/src/source.zig
+++ b/src/source.zig
@@ -9,6 +9,7 @@ pub const Source = struct {
deinit_fn: *const fn (self: *Source, allocator: std.mem.Allocator) void,
register_fn: ?*const fn (self: *Source, name: []const u8, control: *ctrl.ControlServer) void = null,
unregister_fn: ?*const fn (self: *Source, name: []const u8, control: *ctrl.ControlServer) void = null,
+ update_uniform_fn: ?*const fn (self: *Source, param: []const u8, value: gl.UniformPointer) anyerror!void = null,
pub fn deinit(self: *Source, allocator: std.mem.Allocator) void {
self.deinit_fn(self, allocator);
@@ -25,6 +26,12 @@ pub const Source = struct {
unregister_fn(self, name, control);
}
}
+
+ pub fn updateUniform(self: *Source, param: []const u8, value: gl.UniformPointer) anyerror!void {
+ if (self.update_uniform_fn) |update_uniform_fn| {
+ try update_uniform_fn(self, param, value);
+ }
+ }
};
pub const StreamFlags = struct {