I cannot find reference to this. All Android developer docs are focused on OpenGL ES 1.0. How can I start using OpenGL 2.0 in Android SDK using API level 8? If level 8 is not supported then what level I need to use?
What percentage of android phones that are out there in the market currently support OpenGL ES 2.0 ?
While Vulkan is available only on devices running Android 7.0 or higher, OpenGL ES is supported by all Android versions.
The main difference between the two is that OpenGL ES is made for embedded systems like smartphones, while OpenGL is the one on desktops. On the coding level, OpenGL ES does not support fixed-function functions like glBegin/glEnd etc... OpenGL can support fixed-function pipeline (using a compatibility profile).
OpenGL ES 3.2 - Additional OpenGL functionality The latest in the series, OpenGL ES 3.2 added additional functionality based on the Android Extension Pack for OpenGL ES 3.1, which brought the mobile API's functionality significantly closer to it's desktop counterpart - OpenGL.
The problem is that you need to implement three methods in the GLSurfaceView that take at GL10 from the OS.
public void onDrawFrame(GL10 gl)
public void onSurfaceChanged(GL10 gl, int width, int height)
public void onSurfaceCreated(GL10 gl, EGLConfig config)
It looks like the solution is to ignore the GL10 entirely in your Renderer and just use all the GLES20 class's static methods.
public void onDrawFrame(GL10 glUnused) {
GLES20.glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
GLES20.glUseProgram(mProgram);
...
}
All of the GLES20 static members are listed here: http://developer.android.com/reference/android/opengl/GLES20.html
Better documentation on those are in the Khronos docs. http://www.khronos.org/opengles/sdk/docs/man/
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