Add enum support

This commit is contained in:
Not-Nik 2020-05-09 21:12:45 +10:00
parent c1d01c193f
commit 63b0fed263
No known key found for this signature in database
GPG Key ID: 08BB71E672DB3BFD
2 changed files with 9 additions and 5 deletions

View File

@ -37,6 +37,10 @@ def fix_pointer(name: str, t: str):
pre += "[*c]"
if len(pre) != 0:
t = pre + "const " + t
# Hacking specifc enums in here
# Raylib doesn't use the enums but rather the resulting ints
if name == "key" and t == "c_int":
t = "KeyboardKey"
return name, t

View File

@ -83,11 +83,11 @@ pub extern fn DecompressData(compData: [*c]const u8, compDataLength: c_int, data
pub extern fn SaveStorageValue(position: c_uint, value: c_int) void;
pub extern fn LoadStorageValue(position: c_uint) c_int;
pub extern fn OpenURL(url: [*c]const u8) void;
pub extern fn IsKeyPressed(key: c_int) bool;
pub extern fn IsKeyDown(key: c_int) bool;
pub extern fn IsKeyReleased(key: c_int) bool;
pub extern fn IsKeyUp(key: c_int) bool;
pub extern fn SetExitKey(key: c_int) void;
pub extern fn IsKeyPressed(key: KeyboardKey) bool;
pub extern fn IsKeyDown(key: KeyboardKey) bool;
pub extern fn IsKeyReleased(key: KeyboardKey) bool;
pub extern fn IsKeyUp(key: KeyboardKey) bool;
pub extern fn SetExitKey(key: KeyboardKey) void;
pub extern fn GetKeyPressed() c_int;
pub extern fn IsGamepadAvailable(gamepad: c_int) bool;
pub extern fn IsGamepadName(gamepad: c_int, name: [*c]const u8) bool;