From 6bfeb5cbc20e3336d8e2a2147b02b380e2d50378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Wed, 15 Sep 2021 17:05:53 +0700 Subject: Tweak control system to mirror Overgrowth --- src/main.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/main.zig') 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; -- cgit v1.2.3