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?
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.