File: controllercompat.c

package info (click to toggle)
pygame 2.6.1-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 43,076 kB
  • sloc: ansic: 66,932; python: 48,797; javascript: 1,153; objc: 224; sh: 121; makefile: 59; cpp: 25
file content (22 lines) | stat: -rw-r--r-- 733 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * Compat file specifically for controller (see
 * https://github.com/pygame/pygame/pull/3272) we had trouble using pgcompat.c,
 * because it would be included twice, or it would lead to flakiness on
 * compilers, because of threads...
 */

#include <SDL.h>

int
PG_GameControllerRumble(SDL_GameController *gamecontroller,
                        Uint16 low_frequency_rumble,
                        Uint16 high_frequency_rumble, Uint32 duration_ms)
{
#if SDL_VERSION_ATLEAST(2, 0, 9)
    return SDL_GameControllerRumble(gamecontroller, low_frequency_rumble,
                                    high_frequency_rumble, duration_ms);
#else
    SDL_SetError("pygame built without controller rumble support");
    return -1;
#endif
}