Scott
Scott

Reputation: 334

2D iPhone game performance

I'm getting some intermittent bottlenecks on my 2D OpenGL ES iPhone game. When I profiled it in Shark, nothing remarkable came up. In the game, the background takes up the whole screen and I have about 7-8 smaller sprites continuously moving across the screen. For the most part it runs smoothly, but every now and then I'll get a small frame stutter. Is this a common issue with games that have constant movement?

Also, as a side note, I am calling glClear(GL_COLOR_BUFFER_BIT); after each frame is rendered. If I leave this out, I still get some occasional frame skipping, but it's less frequent than if I leave the glClear call in. I'm also using a single spritesheet texture for all my game sprites.

Upvotes: 0

Views: 270

Answers (1)

Brad Larson
Brad Larson

Reputation: 170317

How are you managing your screen refreshes? Maybe you're not exactly synchronized to the display refresh rate. If you're not already, I'd recommend using CADisplayLink to match your refreshes to the display's. Apple's latest OpenGL ES template shows how to do this.

Upvotes: 1

Related Questions