
OpenGL ES 2 – Tutorial 5 – Draw Squares
Every shape we want to draw must be brought back into triangles, therefore OpenGL will draw the square with 2 triangles. The “indices” variable specifies the vertices to be taken from “vertices” for each triangle (counterclockwise). For the first triangle, pair of coordinates x,y: 0, 1 and 2, for the second triangle, pair of coordinates x,y: 2, 1 and 3.