aboutsummaryrefslogtreecommitdiff
path: root/src/imgui.zig
diff options
context:
space:
mode:
authorNic Gaffney <gaffney_nic@protonmail.com>2024-09-09 06:24:13 -0500
committerNic Gaffney <gaffney_nic@protonmail.com>2024-09-09 06:24:13 -0500
commitca3fd842c3edd17a922b041e05471875adc64c44 (patch)
tree0f3d768d8f6311d1e221a1dde6b15f3fa3f7cfe7 /src/imgui.zig
parent78742e53f2a119b7cc9767c4ac211941521d5bf2 (diff)
downloadparticle-sim-ca3fd842c3edd17a922b041e05471875adc64c44.tar.gz
perf: Multithreading and resizable window
Diffstat (limited to 'src/imgui.zig')
-rw-r--r--src/imgui.zig8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/imgui.zig b/src/imgui.zig
index 163ee0f..0796cdb 100644
--- a/src/imgui.zig
+++ b/src/imgui.zig
@@ -24,8 +24,8 @@ pub fn update(alloc: std.mem.Allocator, buf: [:0]u8) !void {
cfg.minDistance = 20.0;
}
_ = z.sliderInt("Particles", .{ .v = &cfg.particleCount, .min = 1, .max = cfg.particleMax });
- _ = z.sliderFloat("Radius", .{ .v = &cfg.radius, .min = 1, .max = 500 });
- _ = z.sliderFloat("Minimum Distance", .{ .v = &cfg.minDistance, .min = 1.0, .max = 100.0 });
+ _ = z.sliderFloat("Radius", .{ .v = &cfg.radius, .min = cfg.minDistance, .max = 500 });
+ _ = z.sliderFloat("Minimum Distance", .{ .v = &cfg.minDistance, .min = 1.0, .max = cfg.radius });
}
if (z.collapsingHeader("Ruleset", .{ .default_open = true })) {
_ = z.beginTable("Rules", .{
@@ -34,7 +34,6 @@ pub fn update(alloc: std.mem.Allocator, buf: [:0]u8) !void {
.outer_size = .{ 0, 0 },
.inner_width = 0,
});
- defer z.endTable();
_ = z.tableNextRow(.{});
_ = z.tableSetColumnIndex(0);
z.text("Rules", .{});
@@ -58,6 +57,9 @@ pub fn update(alloc: std.mem.Allocator, buf: [:0]u8) !void {
_ = z.popItemWidth();
}
}
+ z.endTable();
+ if (z.button("Randomize", .{}))
+ cfg.rules = rul.ruleMatrix();
}
if (z.collapsingHeader("Load / Save", .{ .default_open = true })) {
_ = z.inputText("Save Path", .{ .buf = buf });