SDL2 Introducing Sensors API

Initial work landed in SDL2 on Tuesday by Sam Lantinga for offering a hardware sensor API as their latest major addition to the library. The API is quite generic in being able to query the number of supported sensors, sensor names, types of sensors, read the sensor data, etc.
There's only a dummy sensor driver so far and some Android bits (Update: the initial iOS sensor bits have now landed), but it does appear that the SDL2 sensor API is primarily focused on mobile games with sensors like gyros and accelerometers. Nevertheless, great to see this new API being added to SDL2 for offering more portability by games (or other software) making use of these device sensors.
Those wanting to check out the merged bits can find it via the LibSDL Mercurial repository.
1 Comment