开发者

2D iPhone game performance

开发者 https://www.devze.com 2023-01-10 10:32 出处:网络
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 haveabou

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消