summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules2
m---------lib/gfz0
-rw-r--r--src/main.zig21
3 files changed, 11 insertions, 12 deletions
diff --git a/.gitmodules b/.gitmodules
index ef47a81..d4fb611 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -10,6 +10,6 @@
 [submodule "lib/gfz"]
 	path = lib/gfz
 	url = https://git.sr.ht/~cnx/gfz
-[submodule "lodepng"]
+[submodule "lib/lodepng"]
 	path = lib/lodepng
 	url = https://git.sr.ht/~cnx/lodepng
diff --git a/lib/gfz b/lib/gfz
-Subproject 54468a19adb06eff78a71d425e443171df24b5b
+Subproject bbd457fc16a8d4a637ca08686a584a7d0874450
diff --git a/src/main.zig b/src/main.zig
index f019a61..241e557 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -22,8 +22,6 @@ pub const c = @cImport({
 });
 
 const Loca = @import("loca").Loca;
-const Key = gf.Key;
-const Window = gf.Window;
 const Scores = misc.Scores;
 const al = @import("zeal");
 const allocator = std.heap.c_allocator;
@@ -38,21 +36,22 @@ const std = @import("std");
 
 var game: *c.Game = undefined;
 
-fn resizeWindow(window: Window, width: c_int, height: c_int) void {
+fn resizeWindow(window: gf.Window, width: c_int, height: c_int) void {
     c.resizeWindow(game, width, height);
 }
 
-fn handleKey(window: Window, key: Key, scancode: c_int,
-             action: c_int, mods: c_int) void {
-    c.handleKey(game, @enumToInt(key), action, mods);
+fn handleKey(window: gf.Window, key: gf.Key, scancode: c_int,
+             action: gf.KeyAction, mods: gf.Mods) void {
+    c.handleKey(game, @enumToInt(key), @enumToInt(action), mods.toInt());
 }
 
-fn look(window: Window, xpos: f64, ypos: f64) void {
+fn look(window: gf.Window, xpos: f64, ypos: f64) void {
     c.look(game, xpos, ypos);
 }
 
-fn click(window: Window, button: c_int, action: c_int, mods: c_int) void {
-    c.click(game, button, action, mods);
+fn click(window: gf.Window, button: gf.MouseButton,
+         action: gf.MouseButton.Action, mods: gf.Mods) void {
+    c.click(game, @enumToInt(button), @enumToInt(action), mods.toInt());
 }
 
 pub fn main() !void {
@@ -63,8 +62,8 @@ pub fn main() !void {
 
     try gf.init();
     defer gf.deinit() catch unreachable;
-    const window = try Window.create(config.width, config.height,
-                                     "Black Shades", .{}, .{});
+    const window = try gf.Window.create(config.width, config.height,
+                                        "Black Shades", .{}, .{});
     try window.makeCurrent();
 
     game = c.makeGame(@bitCast(c.Config, config),