What is the different beetween this, and how i can query what is supported by the actual phone? (GL10 or GL11)
i have a HTC Legend, that is supported GL11 or not? Or hero...etc... ?
There's an API for that:
public int getGLVersion()
{
ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
ConfigurationInfo info = am.getDeviceConfigurationInfo();
return info.reqGlEsVersion;
}
The upper order 16 bits represent the major version and the lower order 16 bits the minor version. For more information, visit this link. So:
If you want the string representation (for display), call ConfigurationInfo.getGlEsVersion()
You can use instanceof
on your GL10 instance to test if GL11 or higher is supported:
public void onSurfaceCreated(GL10 gl, EGLConfig config)
{
if(gl instanceof GL11)
{
// ...
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With