Separated graphics into its own file
This commit is contained in:
15
src/main.zig
15
src/main.zig
@@ -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;
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user