GLES10.glGetIntegerv在Samsung设备上返回0

AKr*_*ell 4 android opengl-es samsung-mobile

我使用下面的代码来确定我的drawView方法中位图的最大宽度和高度.在大多数设备上这可以正常工作并返回2048或1024,但在我目前正在测试的三星S3上,它返回0.我做错了什么或者我必须为三星设备找到解决方法吗?

int[] maxSize = new int[1];
GLES10.glGetIntegerv(GLES10.GL_MAX_TEXTURE_SIZE, maxSize, 0);
Log.d("GLES10", "max: " + String.valueOf(maxSize[0]));
Run Code Online (Sandbox Code Playgroud)

AKr*_*ell 5

我找到了问题的根源!我没有在清单中添加hardwareAccelerated ="true"标记,因此它仅适用于默认情况下设置为true的设备.

<application
    ...
    android:hardwareAccelerated="true"
>
Run Code Online (Sandbox Code Playgroud)