Difference between GL10 and GLES10 on Android

Posted by kayahr on Stack Overflow See other posts from Stack Overflow or by kayahr
Published on 2010-05-03T16:59:59Z Indexed on 2010/06/15 23:52 UTC
Read the original article Hit count: 514

Filed under:
|

The GLSurfaceView.Renderer interface of the Android SDK gives me a GL interface as parameter which has the type GL10. This interface is implemented by some private internal jni wrapper class. But there is also the class GLES10 where all the GL methods are available as static methods. Is there an important difference between them? So what if I ignore the gl parameter of onDrawFrame and instead use the static methods of GLES10 everywhere?

Here is an example. Instead of doing this:

void onDrawFrame(GL10 gl)
{
    drawSomething(gl);
}

void drawSomething(GL10 gl)
{
    gl.glLoadIdentity();
    ...
}

I could do this:

void onDrawFrame(GL10 gl)
{
    drawSomething();
}

void drawSomething()
{
    GLES10.glLoadIdentity();
    ...
}

The advantage is that I don't have to pass the GL context to all called methods. But even it it works (And it works, I tried it) I wonder if there are any disadvantages and reasons to NOT do it like that.

© Stack Overflow or respective owner

Related posts about android

Related posts about opengl-es