mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Fix #1934 raylib IsGestureDetected
This commit is contained in:
Vendored
+13
-2
@@ -1219,7 +1219,8 @@ foreign lib {
|
|||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
|
|
||||||
SetGesturesEnabled :: proc(flags: Gestures) --- // Enable a set of gestures using flags
|
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
|
GetGestureDetected :: proc() -> Gestures --- // Get latest detected gesture
|
||||||
GetGestureHoldDuration :: proc() -> f32 --- // Get gesture hold time in milliseconds
|
GetGestureHoldDuration :: proc() -> f32 --- // Get gesture hold time in milliseconds
|
||||||
GetGestureDragVector :: proc() -> Vector2 --- // Get gesture drag vector
|
GetGestureDragVector :: proc() -> Vector2 --- // Get gesture drag vector
|
||||||
@@ -1713,13 +1714,23 @@ foreign lib {
|
|||||||
|
|
||||||
// Workaround for broken IsMouseButtonUp in Raylib 5.0.
|
// Workaround for broken IsMouseButtonUp in Raylib 5.0.
|
||||||
when VERSION == "5.0" {
|
when VERSION == "5.0" {
|
||||||
IsMouseButtonUp :: proc(button: MouseButton) -> bool {
|
IsMouseButtonUp :: proc "c" (button: MouseButton) -> bool {
|
||||||
return !IsMouseButtonDown(button)
|
return !IsMouseButtonDown(button)
|
||||||
}
|
}
|
||||||
} else {
|
} 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.")
|
#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)
|
// Text formatting with variables (sprintf style)
|
||||||
TextFormat :: proc(text: cstring, args: ..any) -> cstring {
|
TextFormat :: proc(text: cstring, args: ..any) -> cstring {
|
||||||
@static buffers: [MAX_TEXTFORMAT_BUFFERS][MAX_TEXT_BUFFER_LENGTH]byte
|
@static buffers: [MAX_TEXTFORMAT_BUFFERS][MAX_TEXT_BUFFER_LENGTH]byte
|
||||||
|
|||||||
Reference in New Issue
Block a user