Renderer/src/plugin.zig

41 lines
1.1 KiB
Zig
Raw Normal View History

2026-07-09 23:16:38 +01:00
const App = @import("app");
const system = @import("system/root.zig");
const resource = @import("resource/root.zig");
/// ----------------------------------------------------
/// ----------------------------------------------------
pub const plugin: App.plugin.Plugin = .{
.name = "Renderer",
.description = "WebGPU Renderer",
.build = build,
};
/// ----------------------------------------------------
/// ----------------------------------------------------
fn build(
_: *App.plugin.Plugin,
ctx: App.plugin.Context,
) !void {
// --- RESOURCES ---
try ctx.app.resources.set(resource.Instance{});
try ctx.app.resources.set(resource.Device{});
try ctx.app.resources.set(resource.window{});
// --- INIT ---
try ctx.app.schedules.addMany(App.stage.Init, &.{
system.instance.init,
system.window.init,
system.device.init,
});
// --- DEINIT ---
try ctx.app.schedules.addMany(App.stage.Deinit, &.{
system.device.deinit,
system.window.deinit,
system.instance.deinit,
});
// --- INPUT ---
try ctx.app.schedules.addMany(App.stage.Inputs, &.{});
}