Separated graphics into its own file

This commit is contained in:
duck
2025-04-24 01:06:16 +05:00
parent 5f50968746
commit a3b358dd99
4 changed files with 92 additions and 27 deletions

View File

@@ -1,8 +1,21 @@
const std = @import("std");
const sdl = @import("sdl.zig");
const Game = @import("game.zig");
pub fn main() !void {
pub fn run_game() !void {
var game = try Game.init();
defer game.deinit();
try game.run();
}
pub fn main() !void {
run_game() catch |err| {
switch (err) {
error.SdlError => {
std.debug.print("SDL Error:\n---\n{s}\n---\n", .{sdl.SDL_GetError()});
},
else => unreachable,
}
return err;
};
}