mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 14:48:47 +00:00
Workaround for bug in Raylib 5 making IsMouseButtonUp not work properly.
This commit is contained in:
Vendored
+7
-4
@@ -1189,10 +1189,10 @@ foreign lib {
|
|||||||
IsMouseButtonPressed :: proc(button: MouseButton) -> bool --- // Detect if a mouse button has been pressed once
|
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
|
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
|
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 --- 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
|
GetMouseX :: proc() -> c.int --- // Returns mouse position X
|
||||||
GetMouseY :: proc() -> c.int --- // Returns mouse position Y
|
GetMouseY :: proc() -> c.int --- // Returns mouse position Y
|
||||||
GetMousePosition :: proc() -> Vector2 --- // Returns mouse position XY
|
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
|
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)
|
// Text formatting with variables (sprintf style)
|
||||||
TextFormat :: proc(text: cstring, args: ..any) -> cstring {
|
TextFormat :: proc(text: cstring, args: ..any) -> cstring {
|
||||||
|
|||||||
Reference in New Issue
Block a user