| 313 | } |
| 314 | |
| 315 | static void SuspendSensors() { |
| 316 | // When our app loses focus, we stop monitoring the accelerometer. |
| 317 | // This is to avoid consuming battery while not being used. |
| 318 | if (accelerometerSensor) { |
| 319 | ASensorEventQueue_disableSensor(sensorEventQueue, accelerometerSensor); |
| 320 | } |
| 321 | if (gyroscopeSensor) { |
| 322 | ASensorEventQueue_disableSensor(sensorEventQueue, gyroscopeSensor); |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | static void WindowSizeChanged(int w, int h) { |
| 327 | currentWindowWidth = w; |