We doing global variables now

This commit is contained in:
duck
2025-07-07 21:11:55 +05:00
parent b2be9e3708
commit 7e162221ef
14 changed files with 521 additions and 1445 deletions

16
src/error.zig Normal file
View File

@@ -0,0 +1,16 @@
const std = @import("std");
const libsdl = @import("sdl");
pub fn sdl() noreturn {
std.debug.panic("SDL Error:\n{s}\n", .{libsdl.GetError()});
}
pub fn oom() noreturn {
std.debug.panic("Out of memory!\n", .{});
}
const FileError = std.mem.Allocator.Error || std.fs.File.OpenError || std.fs.File.ReadError;
pub fn file(err: FileError, path: []const u8) noreturn {
std.debug.panic("Error while reading \"{s}\": {any}", .{ path, err });
}