Game Development Reference
In-Depth Information
4. Finally, when rendering in glkView:drawInRect , we indicate to OpenGL
where to find texture coordinates in the vertex information:
glEnableVertexAttribArray(GLKVertexAttribTexCoord0);
glVertexAttribPointer(GLKVertexAttribTexCoord0, 2,
GL_FLOAT, GL_FALSE,
sizeof(Vertex), (void*)offsetof(Vertex,
textureCoordinates));
When the square is rendered, you'll see your image appear on it, as shown in the
following screenshot:
Search WWH ::




Custom Search