aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Zylinski <karl@zylinski.se>2023-12-17 19:48:19 +0100
committerKarl Zylinski <karl@zylinski.se>2023-12-17 19:48:19 +0100
commit2a0e4f7a8c75f4b475f50cbf92d4fcb09625d202 (patch)
treece9e0f8c5a3d301121bf3f411c696a51eeea1207
parenta4606e4da8cb3c238a07b1a33a24941a9d80b8a3 (diff)
Workaround for bug in Raylib 5 making IsMouseButtonUp not work properly.
-rw-r--r--vendor/raylib/raylib.odin11
1 files changed, 7 insertions, 4 deletions
diff --git a/vendor/raylib/raylib.odin b/vendor/raylib/raylib.odin
index d3632f002..830be6982 100644
--- a/vendor/raylib/raylib.odin
+++ b/vendor/raylib/raylib.odin
@@ -1189,10 +1189,10 @@ foreign lib {
IsMouseButtonPressed :: proc(button: MouseButton) -> bool --- // Detect if a mouse button has been pressed once
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
- IsMouseButtonUp :: proc(button: MouseButton) -> bool { // TODO: remove this when Raylib fixes this bug
- return !IsMouseButtonDown(button)
- }
+
GetMouseX :: proc() -> c.int --- // Returns mouse position X
GetMouseY :: proc() -> c.int --- // Returns mouse position Y
GetMousePosition :: proc() -> Vector2 --- // Returns mouse position XY
@@ -1709,7 +1709,10 @@ 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
+IsMouseButtonUp :: proc(button: MouseButton) -> bool {
+ return !IsMouseButtonDown(button)
+}
// Text formatting with variables (sprintf style)
TextFormat :: proc(text: cstring, args: ..any) -> cstring {