Slow/Laggy response time..

I have a REALLY simple openGL app derived from the template... The animation timer interval is 1/60, and it calls my selector drawView().

The app has 6 total sprites on the screen: 1 background image, and 5 sprites that move around the screen. For some reason, I am getting EXTREMELY slow/laggy response times from moving these sprites around. I'm wondering if its possibly because I am doing all of the updates for these sprites within the drawView() before I do the rendering.

Do I maybe want to create a separate timer for updating these sprites, and keep the drawing on a separate timer? It's really odd behavior, sometimes its smooth and doesn't seem to get bogged down, and others, it seems to be really slow and laggy.

It seems odd that such a simple app with very little happening would have such slow, sluggish behavior.

Any help or possible theories would be greatly appreciated here.

EDIT:

One of the sprites velocity is changed based on accelerometer values... maybe that has something to do with it?

It's more than likely your actual code. Separating your drawing out is generally a bad idea. You want to draw as much at one time as possible.

Did you set the accelerometer to the appropriate refresh rate for your app (try setting a slower accelerometer refresh and only redrawing whatever is accelerometer based when that triggers)? How are you calculating positions? There are so many places where your code may have gone wrong.

It's more than likely your actual code. Separating your drawing out is generally a bad idea. You want to draw as much at one time as possible.

Did you set the accelerometer to the appropriate refresh rate for your app (try setting a slower accelerometer refresh and only redrawing whatever is accelerometer based when that triggers)? How are you calculating positions? There are so many places where your code may have gone wrong.

Click to expand...

I didn't realize you could adjust the accelerometer refresh rate, I will give that a shot.