//draw scene
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_LINE_STRIP);//start to draw something
glColor4ub(255, 0, 0, 255);
glVertex3f(0.0f, 0.0f, -10.0f);
glColor4ub(0, 255, 0, 255);
glVertex3f(-5.0f, 0.0f, -10.0f);
glColor4ub(0, 0, 255, 255);
glVertex3f(-5.0f, -2.0f, -10.0f);
glEnd();//end
glLineWidth设置线宽。
GL_LINES:两个点可以确定一条直线。
GL_LINE_LOOP:所有点连成一个圈。
GL_LINE_STRIP:首位相连不会形成闭环。