2011-01-24 57 views

回答

2

由于着色器程序和纹理属性的名称(本例中的属性被命名为“textureCoords”),你得到的指数是这样的:

int a_texture = glGetAttribLocation(program, "textureCoords"); 

然后用a_texture在glVertexAttribPointer这样的:

glVertexAttribPointer(a_texture, 2, GL_FLOAT, 0, 0, textureVertices); 
+0

谢谢,这是有帮助的。 – 2011-01-25 23:29:50

相关问题