opengl环境配置可参照上一篇博客:控制台+OPENGL配置说明[GLUT篇]
void itDisplay()
{
glClear(GL_COLOR_BUFFER_BIT); //清屏
for(int i=0; i<=count1-1; i=i+2){//绘制线
drawThread(point1[i].x,point1[i].y,point1[i+1].x,point1[i+1].y,point1[i].cx,point1[i].cy,point1[i].cz, point1[i].pointsize, point1[i].model);
}
for(int i=0; i+2<=count2; i=i+3)
{//绘制三角形
drawTriangle(point2[i].x,point2[i].y,point2[i+1].x,point2[i+1].y,point2[i+2].x,point2[i+2].y,point2[i].cx,point2[i].cy,point2[i].cz, point2[i].pointsize, point2[i].model);
}
if((count2+1)%3==2)
{
drawThread(point2[count2-1].x,point2[count2-1].y,point2[count2].x,point2[count2].y,point2[count2-1].cx,point2[count2-1].cy,point2[count2-1].cz, point2[count2 - 1].pointsize, point2[count2 - 1].model);
}
for(int i=0; i<=count3-1; i=i+2)
{//绘制四编写
drawRectangle(point3[i].x,point3[i].y,point3[i+1].x,point3[i+1].y,point3[i].cx,point3[i].cy,point3[i].cz, point3[i].pointsize, point3[i].model);
}
for(int i=0; i<=count4-1; i=i+2)
{//绘制圆
drawCircle(point4[i].x,point4[i].y,point4[i+1].x,point4[i+1].y,point4[i].cx,point4[i].cy,point4[i].cz, point4[i].pointsize, point4[i].model);
}
for (int i = 0; i <= count5 - 1; i = i + 2)
{//绘制平行四边形
drawRectangleParral(point5[i].x, point5[i].y, point5[i + 1].x, point5[i + 1].y, point5[i].cx, point5[i].cy, point5[i].cz, point5[i].pointsize, point5[i].model);
}
for (int i = 0; i <= count6 - 1; i = i + 2)
{//绘制6边形
DrawSixBianXing(point6[i].x, point6[i].y, point6[i + 1].x, point6[i + 1].y, point6[i].cx, point6[i].cy, point6[i].cz, point6[i].pointsize, point6[i].model);
}
for (int i = 0; i <= count7 - 1; i = i + 2)
{
DrawSiBianxing(point7[i].x, point7[i].y, point7[i + 1].x, point7[i + 1].y, point7[i].cx, point7[i].cy, point7[i].cz, point7[i].pointsize, point7[i].model);
}
glFlush(); //送所有输出到显示设备
//glutPostRedisplay();
}