mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-17 16:38:22 +00:00
Fix #1934 raylib IsGestureDetected
This commit is contained in:
15
vendor/raylib/raylib.odin
vendored
15
vendor/raylib/raylib.odin
vendored
@@ -1219,7 +1219,8 @@ foreign lib {
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
SetGesturesEnabled :: proc(flags: Gestures) --- // Enable a set of gestures using flags
|
||||
IsGestureDetected :: proc(gesture: Gesture) -> bool --- // Check if a gesture have been detected
|
||||
// IsGestureDetected :: proc(gesture: Gesture) -> bool --- // Check if a gesture have been detected
|
||||
|
||||
GetGestureDetected :: proc() -> Gestures --- // Get latest detected gesture
|
||||
GetGestureHoldDuration :: proc() -> f32 --- // Get gesture hold time in milliseconds
|
||||
GetGestureDragVector :: proc() -> Vector2 --- // Get gesture drag vector
|
||||
@@ -1713,13 +1714,23 @@ foreign lib {
|
||||
|
||||
// Workaround for broken IsMouseButtonUp in Raylib 5.0.
|
||||
when VERSION == "5.0" {
|
||||
IsMouseButtonUp :: proc(button: MouseButton) -> bool {
|
||||
IsMouseButtonUp :: proc "c" (button: MouseButton) -> bool {
|
||||
return !IsMouseButtonDown(button)
|
||||
}
|
||||
} else {
|
||||
#panic("Remove this this when block and everything inside it for Raylib > 5.0. It's just here to fix a bug in Raylib 5.0. See IsMouseButtonUp inside 'foreign lib {' block.")
|
||||
}
|
||||
|
||||
// Check if a gesture have been detected
|
||||
IsGestureDetected :: proc "c" (gesture: Gesture) -> bool {
|
||||
@(default_calling_convention="c")
|
||||
foreign lib {
|
||||
IsGestureDetected :: proc "c" (gesture: Gestures) -> bool ---
|
||||
}
|
||||
return IsGestureDetected({gesture})
|
||||
}
|
||||
|
||||
|
||||
// Text formatting with variables (sprintf style)
|
||||
TextFormat :: proc(text: cstring, args: ..any) -> cstring {
|
||||
@static buffers: [MAX_TEXTFORMAT_BUFFERS][MAX_TEXT_BUFFER_LENGTH]byte
|
||||
|
||||
Reference in New Issue
Block a user