diff options
| author | Karl Zylinski <karl@zylinski.se> | 2023-12-18 11:19:11 +0100 |
|---|---|---|
| committer | Karl Zylinski <karl@zylinski.se> | 2023-12-18 11:19:11 +0100 |
| commit | 2362be11bf7c6dca9d6c0d7131992833c491bbf7 (patch) | |
| tree | 6c196c2e34ea9a2647bc22c429f393653b86daa2 | |
| parent | 2a0e4f7a8c75f4b475f50cbf92d4fcb09625d202 (diff) | |
Raylib 5.0 bug workaround: Check VERSION and panic if VERSION != 5.0, in which case there is info in the message about how to remove the workaround.
| -rw-r--r-- | vendor/raylib/raylib.odin | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/vendor/raylib/raylib.odin b/vendor/raylib/raylib.odin index 830be6982..4024f7207 100644 --- a/vendor/raylib/raylib.odin +++ b/vendor/raylib/raylib.odin @@ -1190,8 +1190,10 @@ foreign lib { IsMouseButtonDown :: proc(button: MouseButton) -> bool --- // Detect if a mouse button is being pressed IsMouseButtonReleased :: proc(button: MouseButton) -> bool --- // Detect if a mouse button has been released once - // See IsMouseButtonUp below: This proc is broken is Raylib 5 - // IsMouseButtonUp :: proc(button: MouseButton) -> bool --- Detect if a mouse button is NOT being pressed + when VERSION != "5.0" { + #panic("IsMouseButtonUp was broken in Raylib 5.0 but should be fixed in Raylib > 5.1. Remove this panic and the when clause around it and also remove the workaround version of IsMouseButtonUp just after the end of the 'foreign lib {' block ends.") + IsMouseButtonUp :: proc(button: MouseButton) -> bool --- + } GetMouseX :: proc() -> c.int --- // Returns mouse position X GetMouseY :: proc() -> c.int --- // Returns mouse position Y @@ -1709,7 +1711,7 @@ foreign lib { DetachAudioMixedProcessor :: proc(processor: AudioCallback) --- // Detach audio stream processor from the entire audio pipeline } -// TODO: remove this when Raylib releases a new binary version with this bug fixed +// Workaround for broken IsMouseButtonUp in Raylib 5.0. Remove this proc when migrating to Raylib 5.1 or later and re-enable IsMouseButtonUp inside `foreign lib {` block. IsMouseButtonUp :: proc(button: MouseButton) -> bool { return !IsMouseButtonDown(button) } |