aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2021-09-17 22:17:48 +0700
committerNguyễn Gia Phong <mcsinyx@disroot.org>2021-09-17 22:17:48 +0700
commitb1e4fa0d290c3f484054b61f8d2875cae33e099d (patch)
treea35307ae1ce237386da728623ad7211dac8b7513 /src/main.zig
parent1084e3f994eeedaf54cc8c9785f75ddb1727191e (diff)
downloadblackshades-b1e4fa0d290c3f484054b61f8d2875cae33e099d.tar.gz
Convert texture loading code to Zig
LodePNG replaces stb because complicated headers don't play nice with Zig. Textures are now loaded from installed path instead of CWD too.
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.zig b/src/main.zig
index b964536..5c4e1c2 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -17,12 +17,12 @@
// along with Black Shades. If not, see <https://www.gnu.org/licenses/>.
const Loca = @import("loca").Loca;
+const al = @import("zeal");
const allocator = @import("std").heap.c_allocator;
-const gf = @import("gfz");
-const legacy = @cImport(@cInclude("Game.h"));
const configuration = @import("config.zig");
-const al = @import("zeal");
+const gf = @import("gfz");
const gl = @import("zgl");
+const legacy = @cImport(@cInclude("Game.h"));
var game: *legacy.Game = undefined;
@@ -75,6 +75,7 @@ pub fn main() !void {
defer context.deinit() catch unreachable;
try al.useContext(context);
+ _ = @import("misc.zig").loadTexture("Font.png"); // work around laziness
legacy.initGame(game);
defer legacy.closeGame(game);
while (!try window.shouldClose()) {