|
|
代码如下:程序执行后什么都画不出来,问题在哪里,谢谢各位高手
static GLint vertices[]={0.05,0.05,
0.2,0.65,
0.35,0.5,
0.35,0.65,
0.5,0.05,
0.65,0.65};
static GLfloat colors[]={1.0,0.2,0.2,
0.2,0.2,1.0,
0.8,1.0,0.2,
0.75,0.75,0.75,
0.35,0.35,0.35,
0.5,0.5,0.5};
glEnableClientState(GL_COLOR_ARRAY);//??用?到M
glEnableClientState(GL_VERTEX_ARRAY);
glColorPointer(3,GL_FLOAT,0,colors);//指定?到M的??
glVertexPointer(2,GL_INT,0,vertices);
glBegin(GL_TRIANGLES);//这里若改为glBegin(GL_POINTS),就可以画出一个点,但不知道是哪个
glArrayElement(2);
glArrayElement(3);
glArrayElement(5);
glEnd();
glPopMatrix(); //restore transformations
/*Flush drawing commands*/
glFlush();
[em17] |
|