MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / SDL_SensorInit

Function SDL_SensorInit

deps/SDL2/src/sensor/SDL_sensor.c:68–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67
68int
69SDL_SensorInit(void)
70{
71 int i, status;
72
73 /* Create the sensor list lock */
74 if (!SDL_sensor_lock) {
75 SDL_sensor_lock = SDL_CreateMutex();
76 }
77
78#if !SDL_EVENTS_DISABLED
79 if (SDL_InitSubSystem(SDL_INIT_EVENTS) < 0) {
80 return -1;
81 }
82#endif /* !SDL_EVENTS_DISABLED */
83
84 status = -1;
85 for (i = 0; i < SDL_arraysize(SDL_sensor_drivers); ++i) {
86 if (SDL_sensor_drivers[i]->Init() >= 0) {
87 status = 0;
88 }
89 }
90 return status;
91}
92
93/*
94 * Count the number of sensors attached to the system

Callers 1

SDL_InitSubSystemFunction · 0.85

Calls 3

SDL_InitSubSystemFunction · 0.85
SDL_CreateMutexFunction · 0.50
InitMethod · 0.45

Tested by

no test coverage detected