From 17e0f0cb506c71f27045d58207deab95d459fcf2 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Tue, 9 Jul 2024 18:36:24 +0200 Subject: [PATCH] wip imgui --- src/main.zig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main.zig b/src/main.zig index a5fe269..cac1f50 100644 --- a/src/main.zig +++ b/src/main.zig @@ -38,9 +38,10 @@ export fn frame() void { }); //=== UI CODE STARTS HERE - ig.igSetNextWindowPos(.{ .x = 10, .y = 10 }, ig.ImGuiCond_Once, .{ .x = 0, .y = 0 }); - ig.igSetNextWindowSize(.{ .x = 400, .y = 100 }, ig.ImGuiCond_Once); - _ = ig.igBegin("Hello Dear ImGui!", 0, ig.ImGuiWindowFlags_None); + const io = ig.igGetIO(); + ig.igSetNextWindowPos(.{ .x = 0, .y = 0 }, ig.ImGuiCond_Always, .{ .x = 0, .y = 0 }); + ig.igSetNextWindowSize(io.*.DisplaySize, ig.ImGuiCond_Always); + _ = ig.igBegin("Hello Dear ImGui!", 0, ig.ImGuiWindowFlags_NoMove | ig.ImGuiWindowFlags_NoResize | ig.ImGuiWindowFlags_NoTitleBar | ig.ImGuiWindowFlags_NoCollapse); _ = ig.igColorEdit3("Background", &state.pass_action.colors[0].clear_value.r, ig.ImGuiColorEditFlags_None); ig.igEnd(); //=== UI CODE ENDS HERE @@ -68,7 +69,7 @@ pub fn main() void { .frame_cb = frame, .cleanup_cb = cleanup, .event_cb = event, - .window_title = "sokol-zig + Dear Imgui", + .window_title = "Doggo", .width = 800, .height = 600, .icon = .{ .sokol_default = true },