diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.zig | 21 |
1 files changed, 10 insertions, 11 deletions
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), |