mirror of
https://github.com/encounter/SDL.git
synced 2025-12-08 13:15:10 +00:00
Query the rate for the correct sensor (thanks @meyraud705)
This commit is contained in:
@@ -163,7 +163,7 @@ static void AddController(int device_index, SDL_bool verbose)
|
|||||||
|
|
||||||
if (SDL_GameControllerHasSensor(gamecontroller, SDL_SENSOR_GYRO)) {
|
if (SDL_GameControllerHasSensor(gamecontroller, SDL_SENSOR_GYRO)) {
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
SDL_Log("Enabling gyro at %.2f Hz\n", SDL_GameControllerGetSensorDataRate(gamecontroller, SDL_SENSOR_ACCEL));
|
SDL_Log("Enabling gyro at %.2f Hz\n", SDL_GameControllerGetSensorDataRate(gamecontroller, SDL_SENSOR_GYRO));
|
||||||
}
|
}
|
||||||
SDL_GameControllerSetSensorEnabled(gamecontroller, SDL_SENSOR_GYRO, SDL_TRUE);
|
SDL_GameControllerSetSensorEnabled(gamecontroller, SDL_SENSOR_GYRO, SDL_TRUE);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user