Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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);

What is the equivalent to this in OpenGL ES 2.0?

like image 435
iOS Monster Avatar asked Mar 24 '11 13:03

iOS Monster


1 Answers

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.

like image 172
Christian Rau Avatar answered Sep 20 '22 16:09

Christian Rau