mirror of
https://github.com/Not-Nik/raylib-zig.git
synced 2025-09-09 12:07:27 +00:00
Merge pull request #19 from alanoliveira/fix_gamepad_fn
Use the right enum in the IsGamepadButtonXXX functions. Fixes #18
This commit is contained in:
commit
a5b3846731
@ -52,6 +52,9 @@ def fix_enums(arg_name, arg_type, func_name):
|
||||
if arg_name == "key":
|
||||
arg_type = "KeyboardKey"
|
||||
elif arg_name == "button":
|
||||
if "Gamepad" in func_name:
|
||||
arg_type = "GamepadButton"
|
||||
else:
|
||||
arg_type = "MouseButton"
|
||||
elif arg_name == "mode" and func_name == "SetCameraMode":
|
||||
arg_type = "CameraMode"
|
||||
|
@ -9,6 +9,7 @@ const Camera3D = rl.Camera3D;
|
||||
const CameraMode = rl.CameraMode;
|
||||
const Color = rl.Color;
|
||||
const Font = rl.Font;
|
||||
const GamepadButton = rl.GamepadButton;
|
||||
const Gestures = rl.Gestures;
|
||||
const GlyphInfo = rl.GlyphInfo;
|
||||
const Image = rl.Image;
|
||||
@ -192,10 +193,10 @@ pub extern fn GetKeyPressed() c_int;
|
||||
pub extern fn GetCharPressed() c_int;
|
||||
pub extern fn IsGamepadAvailable(gamepad: c_int) bool;
|
||||
pub extern fn GetGamepadName(gamepad: c_int) [*c]const u8;
|
||||
pub extern fn IsGamepadButtonPressed(gamepad: c_int, button: MouseButton) bool;
|
||||
pub extern fn IsGamepadButtonDown(gamepad: c_int, button: MouseButton) bool;
|
||||
pub extern fn IsGamepadButtonReleased(gamepad: c_int, button: MouseButton) bool;
|
||||
pub extern fn IsGamepadButtonUp(gamepad: c_int, button: MouseButton) bool;
|
||||
pub extern fn IsGamepadButtonPressed(gamepad: c_int, button: GamepadButton) bool;
|
||||
pub extern fn IsGamepadButtonDown(gamepad: c_int, button: GamepadButton) bool;
|
||||
pub extern fn IsGamepadButtonReleased(gamepad: c_int, button: GamepadButton) bool;
|
||||
pub extern fn IsGamepadButtonUp(gamepad: c_int, button: GamepadButton) bool;
|
||||
pub extern fn GetGamepadButtonPressed() c_int;
|
||||
pub extern fn GetGamepadAxisCount(gamepad: c_int) c_int;
|
||||
pub extern fn GetGamepadAxisMovement(gamepad: c_int, axis: c_int) f32;
|
||||
|
Loading…
x
Reference in New Issue
Block a user