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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With