it compiles, but initialization is not done create debug messenger Use proxies wip swapchain wip swapchain - stub usage get device queue wip swapchain - scaffolded with segfault wip swapchain - fix segfault wip swapchain - working, but resize broken. semaphore issue with naive handling satisfy validation
87 lines
2.8 KiB
Zig
87 lines
2.8 KiB
Zig
const std = @import("std");
|
|
const nu = @import("nu.zig");
|
|
|
|
pub const nu_modules = .{
|
|
App,
|
|
// UI,
|
|
};
|
|
pub const main = nu.main;
|
|
|
|
pub const nu_options: nu.Options = .{
|
|
.window = .{ .title = "Hello World" },
|
|
.render = .{
|
|
.app_name = "hello-world",
|
|
.frames_in_flight = 3,
|
|
},
|
|
};
|
|
|
|
// pub const UI = struct {
|
|
// const im = nu.ImGui;
|
|
//
|
|
// pub const depends = .{im};
|
|
//
|
|
// var color: @Vector(4, f32) = @splat(1);
|
|
//
|
|
// pub fn setup(_: std.mem.Allocator) !void {
|
|
// const io: *nu.ImGui.ImGuiIO = @ptrCast(nu.ImGui.igGetIO());
|
|
// io.ConfigFlags |= nu.ImGui.ImGuiConfigFlags_DockingEnable;
|
|
// }
|
|
//
|
|
// pub fn frame() !void {
|
|
// nu.ImGui.igShowMetricsWindow(null);
|
|
//
|
|
// {
|
|
// const viewport = im.igGetMainViewport();
|
|
// im.igSetNextWindowPos(viewport.*.WorkPos, 0, .{ .x = 0, .y = 0 });
|
|
// im.igSetNextWindowSize(viewport.*.WorkSize, 0);
|
|
// im.igSetNextWindowViewport(viewport.*.ID);
|
|
// im.igPushStyleVar_Float(im.ImGuiStyleVar_WindowRounding, 0);
|
|
// im.igPushStyleVar_Float(im.ImGuiStyleVar_WindowBorderSize, 0);
|
|
// im.igPushStyleVar_Vec2(im.ImGuiStyleVar_WindowPadding, .{ .x = 0, .y = 0 });
|
|
// defer im.igPopStyleVar(3);
|
|
//
|
|
// const window_flags =
|
|
// im.ImGuiWindowFlags_MenuBar |
|
|
// im.ImGuiWindowFlags_NoDocking |
|
|
// im.ImGuiWindowFlags_NoTitleBar |
|
|
// im.ImGuiWindowFlags_NoCollapse |
|
|
// im.ImGuiWindowFlags_NoResize |
|
|
// im.ImGuiWindowFlags_NoMove |
|
|
// im.ImGuiWindowFlags_NoBringToFrontOnFocus |
|
|
// im.ImGuiWindowFlags_NoNavFocus |
|
|
// im.ImGuiWindowFlags_NoBackground;
|
|
//
|
|
// const dock_flags =
|
|
// im.ImGuiDockNodeFlags_PassthruCentralNode |
|
|
// im.ImGuiDockNodeFlags_NoDockingOverCentralNode;
|
|
//
|
|
// _ = im.igBegin("Main Dockspace", null, window_flags);
|
|
// const id = im.igGetID_Str("maindockspace");
|
|
// _ = im.igDockSpace(id, .{ .x = 0, .y = 0 }, dock_flags, null);
|
|
// im.igEnd();
|
|
// }
|
|
//
|
|
// if (nu.ImGui.igBegin("Color", null, nu.ImGui.ImGuiWindowFlags_None)) {
|
|
// if (nu.ImGui.igColorEdit4("color", @ptrCast(&color), nu.ImGui.ImGuiColorEditFlags_AlphaPreviewHalf)) {}
|
|
// }
|
|
// nu.ImGui.igEnd();
|
|
// }
|
|
// };
|
|
|
|
const App = struct {
|
|
const vk = @import("vk");
|
|
// const au = @import("nu/Render/au.zig");
|
|
|
|
pub const depends = .{nu.Render};
|
|
|
|
// todo timeline semaphore
|
|
|
|
pub fn setup(_: std.mem.Allocator) !void {}
|
|
|
|
pub fn teardown() void {}
|
|
|
|
pub fn frame() !void {}
|
|
|
|
// pub fn present(_: au.CommandBufferProxy) void {}
|
|
};
|