我查看了很多关于andEngine Gles2.0的例子。所有这些都采用了这些:
private static final int CAMERA_WIDTH = 720;
private static final int CAMERA_HEIGHT = 480;
为什么这个值固定了?为什么我不能这样做:
int currentapiVersion = android.os.Build.VERSION.SDK_INT;
int honeyComb = android.os.Build.VERSION_CODES.HONEYCOMB_MR2;
Display display = getWindowManager().getDefaultDisplay();
if (currentapiVersion >= honeyComb) {
Point size = new Point();
display.getSize(size);
CAMERA_WIDTH = size.x;
CAMERA_HEIGHT = size.y;
} else {
CAMERA_WIDTH = display.getWidth();
CAMERA_HEIGHT = display.getHeight();
}
答案 0 :(得分:2)