开发者

Android OpenGLES - Lag between calls to OnDrawFrame on Moto Droid at large resolution

开发者 https://www.devze.com 2023-02-12 03:03 出处:网络
We are currently developing an Android Game using opengles. We are now trying to support different resolutions, however, when allowing for large resolutions, the moto droid we are testing on seems to

We are currently developing an Android Game using opengles. We are now trying to support different resolutions, however, when allowing for large resolutions, the moto droid we are testing on seems to lag at it's native resolution (800x400). We have the frames locked at 30 fps, and when we check, our game only takes about 15-20 ms to do it's updating and drawing on the droid, however, there is sometimes 30-60 ms that elapses between calls to ondrawframe. My Galaxy S device doesn't have this problem, and when we put the resolution down on the motorola droid it seems perfectly fine.

We've investigated the issue and have found people with what seems to have been the exact same issue but no one could offer a solution. Other games on the market that seem to use opengles run fine on the moto droid.

Is there something we're missing? Something we need to call or do to? There seems like there should be no reason for there to be 30-60 ms between calls to ondrawframe, especially when the native resolution (800x400) isn't leaps and bounds larger than the default of 533x320, or whatever it is that it goes to when not allowing for large sc开发者_StackOverflowreens, so it seems ridiculous for it to be because of a buffer swap. The lag even happens when near nothing is being drawn to screen, so it's not because we're drawing too much.

Any enlightenment or help as to how to fix this would be great.


You have to give more information. If its not because of drawing, then it should be because of any calculation or object allocation code. Allocating Objects often during a game, invokes the GC, which is bad for games.

Things about performance and allocating memory for Android games is explained in the links below.

I suggest you watch these 2 videos done by Google Android Group.

http://www.youtube.com/watch?v=U4Bk5rmIpic&feature=player_embedded

http://www.youtube.com/watch?v=7-62tRHLcHk&feature=player_embedded

Hope that helps in optimizing.

0

精彩评论

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