I'm starting to code in openGL ES 2 after several months of doing it in openGL ES 1, and though I'm reading a lot of resources, there are some things I don't understand.
One is thi开发者_JAVA技巧s:
For loading an array of texture coordinates, should I use glMultiTexCoordX or glVertexAttribPointer? Because If I'm not wrong, I can do it either way, so what's the reason glMultiTexCoordX exists?Thanks
glMultiTexCoord* doesn't exist in OpenGL ES 2.0, only glVertexAttribPointer, so use it for all your vertex attributes.
I know it's been a long time, but I still wanna comment this question due to I stuck with same problem. There isn't such method in openGLES version as Matias said. use glVertexAttribPointer instead, here is a instruction: http://www.learnopengles.com/android-lesson-seven-an-introduction-to-vertex-buffer-objects-vbos/
Here is simple code to achieve what glMultiTexCoord in openGLES:
// Pass in the position information
GLES20.glEnableVertexAttribArray(mPositionHandle);
GLES20.glVertexAttribPointer(mPositionHandle, POSITION_DATA_SIZE,
GLES20.GL_FLOAT, false, 0, mCubePositions);
精彩评论