Updated main.zig (idk why but didnt commit)
This commit is contained in:
parent
0d72225229
commit
8dc9953666
1 changed files with 33 additions and 0 deletions
33
src/main.zig
33
src/main.zig
|
|
@ -1,13 +1,46 @@
|
|||
//! ----------------------------------------------------
|
||||
//! ----------------------------------------------------
|
||||
|
||||
//
|
||||
// LIBS
|
||||
//
|
||||
|
||||
const std = @import("std");
|
||||
const App = @import("app");
|
||||
|
||||
//
|
||||
// PLUGINS
|
||||
//
|
||||
|
||||
const template = @import("plugins/template/root.zig");
|
||||
const platform = @import("plugins/platform/root.zig");
|
||||
const device = @import("plugins/device/root.zig");
|
||||
const window = @import("plugins/window/root.zig");
|
||||
|
||||
/// ----------------------------------------------------
|
||||
/// ----------------------------------------------------
|
||||
pub fn main(init: std.process.Init) !void {
|
||||
// --- APP ---
|
||||
var app: App = .init(init.gpa);
|
||||
defer app.deinit();
|
||||
|
||||
// --- ADD PLUGINS ---
|
||||
try app.plugins.addMany(&.{
|
||||
platform.plugin,
|
||||
device.plugin,
|
||||
window.plugin,
|
||||
});
|
||||
try app.plugins.build(&app);
|
||||
|
||||
{ // DEBUG
|
||||
std.debug.print("\x1b[33m┏━\x1b[0m PLUGINS\n", .{});
|
||||
for (app.plugins.data.items) |plugin| {
|
||||
std.debug.print("\x1b[33m┃\x1b[0m {s:<12} {s}\n", .{ plugin.name, plugin.description });
|
||||
}
|
||||
std.debug.print("\x1b[33m┗━\x1b[0m\n", .{});
|
||||
}
|
||||
|
||||
// --- LIFETIME ---
|
||||
try app.schedules.run(App.stage.init, &app);
|
||||
defer app.schedules.runReversed(App.stage.deinit, &app) catch unreachable;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue