में अधिकतम ओपनजीएल ईएस 2.0 बनावट आकार सीमा प्राप्त करें मैं ओपनजीएल 2.0 के लिए एंड्रॉइड में अधिकतम बनावट आकार सीमा प्राप्त करने का प्रयास कर रहा हूं। लेकिन मुझे पता चला है कि अगला निर्देश केवल तभी काम करता है जब मैं ओपनजीएल संदर्भ में हूं, दूसरे शब्दों में मेरे पास एक जीएल सतह और एक जीएल रेंडरर होना चाहिए, जो मैं नहीं चाहता हूं।एंड्रॉइड
int[] maxTextureSize = new int[1];
GLES20.glGetIntegerv(GLES20.GL_MAX_TEXTURE_SIZE, maxTextureSize, 0);
तो मैं अगले एल्गोरिथ्म, जो मुझे किसी भी सतह या रेंडरर बनाए बिना अधिकतम बनावट आकार देता है के साथ आया था। यह सही तरीके से काम करता है, इसलिए मेरा सवाल यह है कि यह सभी एंड्रॉइड डिवाइसों के साथ काम करेगा, और यदि कोई भी बग स्पॉट कर सकता है, तो बस मामले में।
public int getMaximumTextureSize()
{
EGL10 egl = (EGL10)EGLContext.getEGL();
EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
// Initialise
int[] version = new int[2];
egl.eglInitialize(display, version);
// Query total number of configurations
int[] totalConfigurations = new int[1];
egl.eglGetConfigs(display, null, 0, totalConfigurations);
// Query actual list configurations
EGLConfig[] configurationsList = new EGLConfig[totalConfigurations[0]];
egl.eglGetConfigs(display, configurationsList, totalConfigurations[0], totalConfigurations);
int[] textureSize = new int[1];
int maximumTextureSize = 0;
// Iterate through all the configurations to located the maximum texture size
for (int i = 0; i < totalConfigurations[0]; i++)
{
// Only need to check for width since opengl textures are always squared
egl.eglGetConfigAttrib(display, configurationsList[i], EGL10.EGL_MAX_PBUFFER_WIDTH, textureSize);
// Keep track of the maximum texture size
if (maximumTextureSize < textureSize[0])
{
maximumTextureSize = textureSize[0];
}
Log.i("GLHelper", Integer.toString(textureSize[0]));
}
// Release
egl.eglTerminate(display);
Log.i("GLHelper", "Maximum GL texture size: " + Integer.toString(maximumTextureSize));
return maximumTextureSize;
}
क्या आप वाकई जीएल बनावट का आकार ईजीएल पीबीफर आकार से बंधे हैं? क्या यह कहीं ईजीएल 1.0 spec में निहित है? –