Lines Matching refs:index
58 SDL_GetTouchDevice(int index) in SDL_GetTouchDevice() argument
60 if (index < 0 || index >= SDL_num_touch) { in SDL_GetTouchDevice()
61 SDL_SetError("Unknown touch device index %d", index); in SDL_GetTouchDevice()
64 return SDL_touchDevices[index]->id; in SDL_GetTouchDevice()
70 int index; in SDL_GetTouchIndex() local
73 for (index = 0; index < SDL_num_touch; ++index) { in SDL_GetTouchIndex()
74 touch = SDL_touchDevices[index]; in SDL_GetTouchIndex()
76 return index; in SDL_GetTouchIndex()
85 int index = SDL_GetTouchIndex(id); in SDL_GetTouch() local
86 if (index < 0 || index >= SDL_num_touch) { in SDL_GetTouch()
95 return SDL_touchDevices[index]; in SDL_GetTouch()
111 int index; in SDL_GetFingerIndex() local
112 for (index = 0; index < touch->num_fingers; ++index) { in SDL_GetFingerIndex()
113 if (touch->fingers[index]->id == fingerid) { in SDL_GetFingerIndex()
114 return index; in SDL_GetFingerIndex()
123 int index = SDL_GetFingerIndex(touch, id); in SDL_GetFinger() local
124 if (index < 0 || index >= touch->num_fingers) { in SDL_GetFinger()
127 return touch->fingers[index]; in SDL_GetFinger()
141 SDL_GetTouchFinger(SDL_TouchID touchID, int index) in SDL_GetTouchFinger() argument
147 if (index < 0 || index >= touch->num_fingers) { in SDL_GetTouchFinger()
151 return touch->fingers[index]; in SDL_GetTouchFinger()
158 int index; in SDL_AddTouch() local
160 index = SDL_GetTouchIndex(touchID); in SDL_AddTouch()
161 if (index >= 0) { in SDL_AddTouch()
162 return index; in SDL_AddTouch()
173 index = SDL_num_touch; in SDL_AddTouch()
175 SDL_touchDevices[index] = (SDL_Touch *) SDL_malloc(sizeof(*SDL_touchDevices[index])); in SDL_AddTouch()
176 if (!SDL_touchDevices[index]) { in SDL_AddTouch()
184 SDL_touchDevices[index]->id = touchID; in SDL_AddTouch()
185 SDL_touchDevices[index]->type = type; in SDL_AddTouch()
186 SDL_touchDevices[index]->num_fingers = 0; in SDL_AddTouch()
187 SDL_touchDevices[index]->max_fingers = 0; in SDL_AddTouch()
188 SDL_touchDevices[index]->fingers = NULL; in SDL_AddTouch()
194 return index; in SDL_AddTouch()
229 int index = SDL_GetFingerIndex(touch, fingerid); in SDL_DelFinger() local
230 if (index < 0) { in SDL_DelFinger()
235 temp = touch->fingers[index]; in SDL_DelFinger()
236 touch->fingers[index] = touch->fingers[touch->num_fingers]; in SDL_DelFinger()
444 int index = SDL_GetTouchIndex(id); in SDL_DelTouch() local
458 SDL_touchDevices[index] = SDL_touchDevices[SDL_num_touch]; in SDL_DelTouch()