mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Sensor in Joystick.
This commit is contained in:
@@ -156,6 +156,19 @@ Sensor::SensorType Sensor::convert(SDL_SensorType type)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_SensorType Sensor::convert(Sensor::SensorType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case SENSOR_ACCELEROMETER:
|
||||
return SDL_SENSOR_ACCEL;
|
||||
case SENSOR_GYROSCOPE:
|
||||
return SDL_SENSOR_GYRO;
|
||||
default:
|
||||
return SDL_SENSOR_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ public:
|
||||
const char *getSensorName(SensorType type) override;
|
||||
|
||||
static SensorType convert(SDL_SensorType type);
|
||||
static SDL_SensorType convert(SensorType type);
|
||||
|
||||
private:
|
||||
std::map<SensorType, SDL_Sensor*> sensors;
|
||||
|
||||
Reference in New Issue
Block a user