summary refs log tree commit diff
path: root/src/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.zig b/src/main.zig
index 17c4119..b964536 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -40,6 +40,11 @@ fn look(window: ?*gf.Window.Impl, xpos: f64, ypos: f64) callconv(.C) void {
     legacy.look(game, xpos, ypos);
 }
 
+fn click(window: ?*gf.Window.Impl, button: c_int,
+         action: c_int, mods: c_int) callconv(.C) void {
+    legacy.click(game, button, action, mods);
+}
+
 pub fn main() !void {
     const loca = try Loca.init(allocator, .{});
     defer loca.deinit();
@@ -58,10 +63,11 @@ pub fn main() !void {
 
     if (try gf.rawMouseMotionSupported())
         try window.setInputMode(.raw_mouse_motion, true);
+    try window.setCursorPosCallback(look);
     try window.setInputMode(.sticky_mouse_buttons, true);
+    try window.setMouseButtonCallback(click);
     try window.setInputMode(.sticky_keys, true);
     try window.setKeyCallback(handleKey);
-    try window.setCursorPosCallback(look);
 
     const device = try al.Device.init(null);
     defer device.deinit() catch unreachable;