opengles中使用顶点数组

static GLfloat triangles[]={0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0};
static GLfloat triangles2[]={-1.0,-1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,0.0};
void renderFrame() {
glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
glClearColor(0.0f,1.0f,1.0f,1.0f);

glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3,GL_FLOAT,0,triangles);
glDrawArrays(GL_TRIANGLES,0,3);
glVertexPointer(3,GL_FLOAT,0,triangles2);
glDrawArrays(GL_TRIANGLES,0,3);
}

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>