mirror of
https://github.com/Not-Nik/raylib-zig.git
synced 2025-09-09 03:57:29 +00:00
Use GamepadAxis enum for getGamepadAxisMovement instead of c_int (#187)
* Updated getGamepadAxisMovement to take enum and cast return to f32 * Updated raylib-ext.zig GetGamepadAxisMovement to take enum * modified generate_functions.py to make changes instead
This commit is contained in:
parent
561481f4ae
commit
30ce68004f
@ -173,6 +173,7 @@ _fix_enums_data = [
|
||||
("flag", "ConfigFlags", r"IsWindowState"),
|
||||
("flags", "Gesture", r"SetGesturesEnabled"),
|
||||
("button", "GamepadButton", r".*GamepadButton.*"),
|
||||
("axis", "GamepadAxis", r".*GamepadAxis.*"),
|
||||
("button", "MouseButton", r".*MouseButton.*"),
|
||||
("control", "GuiControl", r"Gui.etStyle"),
|
||||
# ("property", "GuiControlProperty", r"Gui.etStyle"),
|
||||
|
@ -177,7 +177,7 @@ pub extern "c" fn IsGamepadButtonReleased(gamepad: c_int, button: rl.GamepadButt
|
||||
pub extern "c" fn IsGamepadButtonUp(gamepad: c_int, button: rl.GamepadButton) bool;
|
||||
pub extern "c" fn GetGamepadButtonPressed() rl.GamepadButton;
|
||||
pub extern "c" fn GetGamepadAxisCount(gamepad: c_int) c_int;
|
||||
pub extern "c" fn GetGamepadAxisMovement(gamepad: c_int, axis: c_int) f32;
|
||||
pub extern "c" fn GetGamepadAxisMovement(gamepad: c_int, axis: rl.GamepadAxis) f32;
|
||||
pub extern "c" fn SetGamepadMappings(mappings: [*c]const u8) c_int;
|
||||
pub extern "c" fn SetGamepadVibration(gamepad: c_int, leftMotor: f32, rightMotor: f32, duration: f32) void;
|
||||
pub extern "c" fn IsMouseButtonPressed(button: rl.MouseButton) bool;
|
||||
|
@ -3169,8 +3169,8 @@ pub fn getGamepadAxisCount(gamepad: i32) i32 {
|
||||
}
|
||||
|
||||
/// Get axis movement value for a gamepad axis
|
||||
pub fn getGamepadAxisMovement(gamepad: i32, axis: i32) f32 {
|
||||
return cdef.GetGamepadAxisMovement(@as(c_int, gamepad), @as(c_int, axis));
|
||||
pub fn getGamepadAxisMovement(gamepad: i32, axis: GamepadAxis) f32 {
|
||||
return cdef.GetGamepadAxisMovement(@as(c_int, gamepad), axis);
|
||||
}
|
||||
|
||||
/// Set internal gamepad mappings (SDL_GameControllerDB)
|
||||
|
Loading…
x
Reference in New Issue
Block a user