What is the difference between GLES20.glTexImage2d() and GLUtils.texImage2d() in Android?

1.1k views Asked by At

I was trying to load a bitmap as a texture in opengl on Android platform. Although, I got it working by using

GLUtils.texImage2d()

but crashes when I use

GLES20.glTexImage2d().

What is the difference between them? When to use the former and the latter?

1

There are 1 answers

0
Mik On

GLUtils.texImage2d() is an helper to load a texture from an Android Bitmap. GLES20.glTexImage2d() is the standard GL-ES function that load an image from a Java NIO Buffer. Prefer GLUtils function if you want to load images from files, it is much simple.