I'm writing a 2D game using Qt. The idea is that the control system will use accelerometer via classes: QAccelerometer and QAccelerometerReading.
It works, but when I display many gfx items on screen there are delays in accelerometer data readings though game framerate is stable (around 25 fps).
By delays I mean that when I pivot phone in a direction accelerometer provides changes after 3-4 seconds later (not real time) which is not acceptable for game purposes.
I'm using Nokia N97 and 5800 for my development.
I also tried the following schemes:
1. Pulling accelerometer data in every animation frame
2. Pulling accelerometer data every 20 ms
3. Using separate thread to pull accelerometer data 25 times a second
Results are always similar - it works for a while reasonable ok and after a few moments I get the delays in reading. Maybe it's phone software is busy rendering my game and got problems in accelerometer data updates ?
Can someone explain whether there's a design pattern for using accelerometer in games ?
Also is there a way to receive accelerometer in real time (via Symbian C++ code maybe) ?
Thanks in advance for help.