mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 15:21:44 +00:00
parent
7d4cfd4acd
commit
0960984c91
1 changed files with 6 additions and 2 deletions
|
@ -171,12 +171,12 @@ static cvar_t *gyro_calibration_x;
|
||||||
static cvar_t *gyro_calibration_y;
|
static cvar_t *gyro_calibration_y;
|
||||||
static cvar_t *gyro_calibration_z;
|
static cvar_t *gyro_calibration_z;
|
||||||
|
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 16) // support for controller sensors (gyro, accelerometer)
|
#if SDL_VERSION_ATLEAST(2, 0, 14) // support for controller sensors (gyro, accelerometer)
|
||||||
|
|
||||||
static unsigned int num_samples;
|
static unsigned int num_samples;
|
||||||
#define NATIVE_SDL_GYRO // uses SDL_CONTROLLERSENSORUPDATE to read gyro
|
#define NATIVE_SDL_GYRO // uses SDL_CONTROLLERSENSORUPDATE to read gyro
|
||||||
|
|
||||||
#else // for SDL < 2.0.16, gyro can be read as a "secondary joystick" exposed by dkms-hid-nintendo
|
#else // for SDL < 2.0.14, gyro can be read as a "secondary joystick" exposed by dkms-hid-nintendo
|
||||||
|
|
||||||
static unsigned int num_samples[3];
|
static unsigned int num_samples[3];
|
||||||
static SDL_Joystick *imu_joystick = NULL; // gyro "joystick"
|
static SDL_Joystick *imu_joystick = NULL; // gyro "joystick"
|
||||||
|
@ -2176,8 +2176,12 @@ IN_Controller_Init(qboolean notify_user)
|
||||||
&& !SDL_GameControllerSetSensorEnabled(controller, SDL_SENSOR_GYRO, SDL_TRUE) )
|
&& !SDL_GameControllerSetSensorEnabled(controller, SDL_SENSOR_GYRO, SDL_TRUE) )
|
||||||
{
|
{
|
||||||
show_gyro = true;
|
show_gyro = true;
|
||||||
|
#if SDL_VERSION_ATLEAST(2, 0, 16)
|
||||||
Com_Printf( "Gyro sensor enabled at %.2f Hz\n",
|
Com_Printf( "Gyro sensor enabled at %.2f Hz\n",
|
||||||
SDL_GameControllerGetSensorDataRate(controller, SDL_SENSOR_GYRO) );
|
SDL_GameControllerGetSensorDataRate(controller, SDL_SENSOR_GYRO) );
|
||||||
|
#else
|
||||||
|
Com_Printf( "Gyro sensor enabled.\n" );
|
||||||
|
#endif // #if SDL_VERSION_ATLEAST(2, 0, 16)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue