-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgesture.go
50 lines (37 loc) · 796 Bytes
/
gesture.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package sdl
// #include <SDL.h>
import "C"
type GestureID C.SDL_GestureID
func (id GestureID) c() C.SDL_GestureID {
return C.SDL_GestureID(id)
}
func RecordGesture() error {
if C.SDL_RecordGesture(-1) != 0 {
return getError()
}
return nil
}
func (id TouchID) RecordGesture() error {
if C.SDL_RecordGesture(id.c()) != 0 {
return getError()
}
return nil
}
func SaveAllDollarTemplates(rw *RWops) error {
if C.SDL_SaveAllDollarTemplates(rw.c) != 0 {
return getError()
}
return nil
}
func SaveDollarTemplate(rw *RWops, id GestureID) error {
if C.SDL_SaveDollarTemplate(id.c(), rw.c) != 0 {
return getError()
}
return nil
}
func LoadDollarTemplates(rw *RWops, id TouchID) error {
if C.SDL_LoadDollarTemplates(id.c(), rw.c) != 0 {
return getError()
}
return nil
}