wip imgui

This commit is contained in:
Fabien Freling 2024-07-09 18:36:24 +02:00
parent 683756900c
commit 17e0f0cb50

View file

@ -38,9 +38,10 @@ export fn frame() void {
}); });
//=== UI CODE STARTS HERE //=== UI CODE STARTS HERE
ig.igSetNextWindowPos(.{ .x = 10, .y = 10 }, ig.ImGuiCond_Once, .{ .x = 0, .y = 0 }); const io = ig.igGetIO();
ig.igSetNextWindowSize(.{ .x = 400, .y = 100 }, ig.ImGuiCond_Once); ig.igSetNextWindowPos(.{ .x = 0, .y = 0 }, ig.ImGuiCond_Always, .{ .x = 0, .y = 0 });
_ = ig.igBegin("Hello Dear ImGui!", 0, ig.ImGuiWindowFlags_None); 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.igColorEdit3("Background", &state.pass_action.colors[0].clear_value.r, ig.ImGuiColorEditFlags_None);
ig.igEnd(); ig.igEnd();
//=== UI CODE ENDS HERE //=== UI CODE ENDS HERE
@ -68,7 +69,7 @@ pub fn main() void {
.frame_cb = frame, .frame_cb = frame,
.cleanup_cb = cleanup, .cleanup_cb = cleanup,
.event_cb = event, .event_cb = event,
.window_title = "sokol-zig + Dear Imgui", .window_title = "Doggo",
.width = 800, .width = 800,
.height = 600, .height = 600,
.icon = .{ .sokol_default = true }, .icon = .{ .sokol_default = true },