revert bad entrypoint API design changes

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2024-08-23 23:03:54 -07:00
parent ee4d3886e5
commit bfa3b069f7
10 changed files with 65 additions and 87 deletions

View file

@ -8,11 +8,9 @@ pub const modules = .{
};
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
// Initialize mach.Core
try mach.core.initModule();
var app = try mach.App.init(allocator, .app);
defer app.deinit(allocator);
try app.run(.{ .allocator = allocator });
// Main loop
while (try mach.core.tick()) {}
}

View file

@ -8,11 +8,9 @@ pub const modules = .{
};
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
// Initialize mach.Core
try mach.core.initModule();
var app = try mach.App.init(allocator, .app);
defer app.deinit(allocator);
try app.run(.{ .allocator = allocator });
// Main loop
while (try mach.core.tick()) {}
}

View file

@ -10,11 +10,9 @@ pub const modules = .{
};
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
// Initialize mach.Core
try mach.core.initModule();
var app = try mach.App.init(allocator, .app);
defer app.deinit(allocator);
try app.run(.{ .allocator = allocator });
// Main loop
while (try mach.core.tick()) {}
}

View file

@ -11,11 +11,9 @@ pub const modules = .{
// TODO(important): use standard entrypoint instead
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
// Initialize mach.Core
try mach.core.initModule();
var app = try mach.App.init(allocator, .app);
defer app.deinit(allocator);
try app.run(.{ .allocator = allocator });
// Main loop
while (try mach.core.tick()) {}
}

View file

@ -12,11 +12,9 @@ pub const modules = .{
// TODO(important): use standard entrypoint instead
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
// Initialize mach.Core
try mach.core.initModule();
var app = try mach.App.init(allocator, .app);
defer app.deinit(allocator);
try app.run(.{ .allocator = allocator });
// Main loop
while (try mach.core.tick()) {}
}

View file

@ -10,11 +10,9 @@ pub const modules = .{
// TODO(important): use standard entrypoint instead
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
// Initialize mach.Core
try mach.core.initModule();
var app = try mach.App.init(allocator, .app);
defer app.deinit(allocator);
try app.run(.{ .allocator = allocator });
// Main loop
while (try mach.core.tick()) {}
}

View file

@ -10,11 +10,9 @@ pub const modules = .{
// TODO(important): use standard entrypoint instead
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
// Initialize mach.Core
try mach.core.initModule();
var app = try mach.App.init(allocator, .app);
defer app.deinit(allocator);
try app.run(.{ .allocator = allocator });
// Main loop
while (try mach.core.tick()) {}
}

View file

@ -10,11 +10,9 @@ pub const modules = .{
// TODO(important): use standard entrypoint instead
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
// Initialize mach.Core
try mach.core.initModule();
var app = try mach.App.init(allocator, .app);
defer app.deinit(allocator);
try app.run(.{ .allocator = allocator });
// Main loop
while (try mach.core.tick()) {}
}

View file

@ -10,11 +10,9 @@ pub const modules = .{
// TODO(important): use standard entrypoint instead
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
// Initialize mach.Core
try mach.core.initModule();
var app = try mach.App.init(allocator, .app);
defer app.deinit(allocator);
try app.run(.{ .allocator = allocator });
// Main loop
while (try mach.core.tick()) {}
}