What should I use in place of glTexCoordPointer() in OpenGL ES 2.0?
In OpenGL ES 1, I have a function like the following for setting up the coordinates of an image:
glTexCoordPointer(2, GL_FLOAT, 0, coordinates);
W开发者_StackOverflow中文版hat is the equivalent to this in OpenGL ES 2.0?
As far as I know, all the fixed-function attributes (like vertex, normal, texcoords, ...) have been removed in GLES 2.0. You have to implement your own vertex shader, that accepts the texture coordinates as a custom vertex attribute (whose data is specified by glVertexAttribPointer
, like for every other vertex attribute) and which delegates the texture coordinates to your own fragment shader, that implements the texture access. If this all sounds alien to you, you might want to delve a bit deeper into GLSL shaders.
精彩评论