diff --git a/examples/core/basic_screen_manager.zig b/examples/core/basic_screen_manager.zig index 2664693..7869501 100644 --- a/examples/core/basic_screen_manager.zig +++ b/examples/core/basic_screen_manager.zig @@ -56,7 +56,7 @@ pub fn main() anyerror!void { // TODO: Update `title` state variables here! // Press ENTER to change to `gameplay` state - if (rl.isKeyPressed(.enter) or rl.isGestureDetected(.tap)) { + if (rl.isKeyPressed(.enter) or rl.isGestureDetected(.{ .tap = true })) { current_screen = .gameplay; } }, @@ -64,7 +64,7 @@ pub fn main() anyerror!void { // TODO: Update `gameplay` state variables here! // Press ENTER to change to `ending` state - if (rl.isKeyPressed(.enter) or rl.isGestureDetected(.tap)) { + if (rl.isKeyPressed(.enter) or rl.isGestureDetected(.{ .tap = true })) { current_screen = .ending; } }, @@ -72,7 +72,7 @@ pub fn main() anyerror!void { // TODO: Update `ending` state variables here! // Press ENTER to return to `title` state - if (rl.isKeyPressed(.enter) or rl.isGestureDetected(.tap)) { + if (rl.isKeyPressed(.enter) or rl.isGestureDetected(.{ .tap = true })) { current_screen = .title; } }, diff --git a/lib/preludes/raylib-prelude.zig b/lib/preludes/raylib-prelude.zig index d81bbb1..c6ff930 100644 --- a/lib/preludes/raylib-prelude.zig +++ b/lib/preludes/raylib-prelude.zig @@ -1998,18 +1998,23 @@ pub const BlendMode = enum(c_int) { custom_separate = 7, }; -pub const Gesture = enum(c_int) { - none = 0, - tap = 1, - doubletap = 2, - hold = 4, - drag = 8, - swipe_right = 16, - swipe_left = 32, - swipe_up = 64, - swipe_down = 128, - pinch_in = 256, - pinch_out = 512, +pub const Gesture = packed struct { + tap: bool = false, + doubletap: bool = false, + hold: bool = false, + drag: bool = false, + swipe_right: bool = false, + swipe_left: bool = false, + swipe_up: bool = false, + swipe_down: bool = false, + pinch_in: bool = false, + pinch_out: bool = false, + __reserved1: bool = false, + __reserved2: bool = false, + __reserved3: bool = false, + __reserved4: bool = false, + __reserved5: bool = false, + __reserved6: bool = false, }; pub const CameraMode = enum(c_int) { diff --git a/lib/raylib.zig b/lib/raylib.zig index b572da8..55699ee 100644 --- a/lib/raylib.zig +++ b/lib/raylib.zig @@ -1998,18 +1998,23 @@ pub const BlendMode = enum(c_int) { custom_separate = 7, }; -pub const Gesture = enum(c_int) { - none = 0, - tap = 1, - doubletap = 2, - hold = 4, - drag = 8, - swipe_right = 16, - swipe_left = 32, - swipe_up = 64, - swipe_down = 128, - pinch_in = 256, - pinch_out = 512, +pub const Gesture = packed struct { + tap: bool = false, + doubletap: bool = false, + hold: bool = false, + drag: bool = false, + swipe_right: bool = false, + swipe_left: bool = false, + swipe_up: bool = false, + swipe_down: bool = false, + pinch_in: bool = false, + pinch_out: bool = false, + __reserved1: bool = false, + __reserved2: bool = false, + __reserved3: bool = false, + __reserved4: bool = false, + __reserved5: bool = false, + __reserved6: bool = false, }; pub const CameraMode = enum(c_int) {