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
2 changed files with 9 additions and 5 deletions
|
|
@ -52,7 +52,10 @@ def fix_enums(arg_name, arg_type, func_name):
|
||||||
if arg_name == "key":
|
if arg_name == "key":
|
||||||
arg_type = "KeyboardKey"
|
arg_type = "KeyboardKey"
|
||||||
elif arg_name == "button":
|
elif arg_name == "button":
|
||||||
arg_type = "MouseButton"
|
if "Gamepad" in func_name:
|
||||||
|
arg_type = "GamepadButton"
|
||||||
|
else:
|
||||||
|
arg_type = "MouseButton"
|
||||||
elif arg_name == "mode" and func_name == "SetCameraMode":
|
elif arg_name == "mode" and func_name == "SetCameraMode":
|
||||||
arg_type = "CameraMode"
|
arg_type = "CameraMode"
|
||||||
elif arg_name == "gesture":
|
elif arg_name == "gesture":
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ const Camera3D = rl.Camera3D;
|
||||||
const CameraMode = rl.CameraMode;
|
const CameraMode = rl.CameraMode;
|
||||||
const Color = rl.Color;
|
const Color = rl.Color;
|
||||||
const Font = rl.Font;
|
const Font = rl.Font;
|
||||||
|
const GamepadButton = rl.GamepadButton;
|
||||||
const Gestures = rl.Gestures;
|
const Gestures = rl.Gestures;
|
||||||
const GlyphInfo = rl.GlyphInfo;
|
const GlyphInfo = rl.GlyphInfo;
|
||||||
const Image = rl.Image;
|
const Image = rl.Image;
|
||||||
|
|
@ -192,10 +193,10 @@ pub extern fn GetKeyPressed() c_int;
|
||||||
pub extern fn GetCharPressed() c_int;
|
pub extern fn GetCharPressed() c_int;
|
||||||
pub extern fn IsGamepadAvailable(gamepad: c_int) bool;
|
pub extern fn IsGamepadAvailable(gamepad: c_int) bool;
|
||||||
pub extern fn GetGamepadName(gamepad: c_int) [*c]const u8;
|
pub extern fn GetGamepadName(gamepad: c_int) [*c]const u8;
|
||||||
pub extern fn IsGamepadButtonPressed(gamepad: c_int, button: MouseButton) bool;
|
pub extern fn IsGamepadButtonPressed(gamepad: c_int, button: GamepadButton) bool;
|
||||||
pub extern fn IsGamepadButtonDown(gamepad: c_int, button: MouseButton) bool;
|
pub extern fn IsGamepadButtonDown(gamepad: c_int, button: GamepadButton) bool;
|
||||||
pub extern fn IsGamepadButtonReleased(gamepad: c_int, button: MouseButton) bool;
|
pub extern fn IsGamepadButtonReleased(gamepad: c_int, button: GamepadButton) bool;
|
||||||
pub extern fn IsGamepadButtonUp(gamepad: c_int, button: MouseButton) bool;
|
pub extern fn IsGamepadButtonUp(gamepad: c_int, button: GamepadButton) bool;
|
||||||
pub extern fn GetGamepadButtonPressed() c_int;
|
pub extern fn GetGamepadButtonPressed() c_int;
|
||||||
pub extern fn GetGamepadAxisCount(gamepad: c_int) c_int;
|
pub extern fn GetGamepadAxisCount(gamepad: c_int) c_int;
|
||||||
pub extern fn GetGamepadAxisMovement(gamepad: c_int, axis: c_int) f32;
|
pub extern fn GetGamepadAxisMovement(gamepad: c_int, axis: c_int) f32;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue