How to use OpenGL ES 2.0 in Android SDK (not NDK)?

I can not find a link to this. All Android developer documents are focused on OpenGL ES 1.0. How can I start using OpenGL 2.0 in the Android SDK using API level 8? If level 8 is not supported, then which level should I use?

What percentage of the Android phones currently on the market supports OpenGL ES 2.0?

+5
source share
3 answers

The problem is that you need to implement three methods in GLSurfaceView that execute in 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 seems like the solution is to completely ignore GL10 in your Renderer and just use all the static methods of the GLES20 class.

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);
        ...
}

GLES20 : http://developer.android.com/reference/android/opengl/GLES20.html

Khronos. http://www.khronos.org/opengles/sdk/docs/man/

+8

http://www.youtube.com/watch?v=7-62tRHLcHk. OpenGL ES , OpenGL Android. , . 2.0 2009 . 2,0 , , , , , X .

, OpenGL SDK, 21:00 .

+3

All Articles