I m trying out some game engines for android and came across cocos2d-android-1. I ve set up a small example that pretty much does nothing except to show a FPS counter to start with.
The problem is that every time the activity goes to the background (via the home or back key) and comes back, the FPS drop a lot. At the first start they are around 60 for me (HTC Desire), after resuming the activity they stay below 10.
这项活动固定在标识中,并使用@android:e/Theme.Black.NoTitle Bar.Fulleen
,以便采用完整的筛选方式。
当我停止在装置环境中从应用菜单中取回时,它会照搬一切。 第一次发射再次出现60个浮点,次发射也有所下降。
我如何确定这一点?
这里是一个小型的工作样本:
public class MainActivity extends Activity {
private CCGLSurfaceView glSurfaceView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
glSurfaceView = new CCGLSurfaceView(this);
setContentView(glSurfaceView);
}
@Override
public void onStart() {
super.onStart();
CCDirector.sharedDirector().attachInView(glSurfaceView);
CCDirector.sharedDirector().setDisplayFPS(true);
}
@Override
public void onPause() {
super.onPause();
CCDirector.sharedDirector().pause();
}
}