diff options
| author | s-ol <s+removethis@s-ol.nu> | 2025-03-16 20:28:37 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2025-03-16 20:28:37 +0000 |
| commit | c8dc761d195c8a986c4b6853266e53f6abad9613 (patch) | |
| tree | ee8e81518c3eedfd773915f9404e757135f981c5 /src/config.zig | |
| parent | cache textures by filename (diff) | |
| download | glsl-view-c8dc761d195c8a986c4b6853266e53f6abad9613.tar.gz glsl-view-c8dc761d195c8a986c4b6853266e53f6abad9613.zip | |
default output size to render size
Diffstat (limited to 'src/config.zig')
| -rw-r--r-- | src/config.zig | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/config.zig b/src/config.zig index 2710822..a024dfa 100644 --- a/src/config.zig +++ b/src/config.zig @@ -29,7 +29,7 @@ pub const Config = struct { pub const default: Config = .{ .width = 1920, .height = 1080, - .outputs = ([_]OutputConfig{.default})[0..], + .outputs = &.{}, .osc = "osc.udp://:9000", }; @@ -54,6 +54,14 @@ pub const Config = struct { // @TODO: output config } + if (config.outputs.len == 0) { + var output = try allocator.create(OutputConfig); + output.* = .{ .window = .default }; + output.window.width = config.width; + output.window.height = config.height; + config.outputs = @as(*[1]OutputConfig, output); + } + return config; } }; |
