当前位置:网站首页>Openes version query

Openes version query

2022-07-05 09:53:00 Anemone

Android OpenES edition

Version statement

<!-- Tell the system this app requires OpenGL ES 2.0. -->
<uses-feature android:glEsVersion="0x00020000" android:required="true" />

Version query

Method 1

    ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
    ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
    Log.e("MainActivity", "version: " + Integer.toHexString(configurationInfo.reqGlEsVersion));

Method 2

GL gl from Renderer Of onSurfaceCreated obtain

gl.glGetString(GL10.GL_VERSION)

summary

For runtime determination OpenGL ES Version of , We can get it first configurationInfo.reqGlEsVersion
And then setRenderer() Pre invocation setEGLContextClientVersion();

other

 have access to EGLContextFactory  establish EGLContext.( For example, you can try to create a higher version EGLContext, Determine whether the higher version is supported OpenGL ES)

Reference resources
[1]:https://blog.csdn.net/JektonLuo/article/details/79521382
[2]:https://developer.android.google.cn/guide/topics/graphics/opengl?hl=en#version-check

原网站

版权声明
本文为[Anemone]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140535430634.html