} glBegin(GL_POINTS); glVertex3f(x,y,0); for(int k=1;k<=steps;k++) { x+=delta_x; y+=delta_y; glBegin(GL_POINTS); glVertex3f(x,y,0); glEnd(); }
/* the display callback: */
void display1() //画圆
{
glClear(GL_COLOR_BUFFER_BIT); /*clear the window */
/*----------------------------------------*/
/* viewport stuff */
/*----------------------------------------*/
/* set up a viewport in the screen window */ /* args to glViewport are left, bottom, width, height */ glViewport(0, 0, 500, 500); /* NB: default viewport has same coords as in myinit, */
/* so this could be omitted: */
dda_line(20,20,420,350);
/* and flush that buffer to the screen */
glFlush();
}
void display2() //画圆
{
glClear(GL_COLOR_BUFFER_BIT); /*clear the window */
/*----------------------------------------*/
/* viewport stuff */
/*----------------------------------------*/
/* set up a viewport in the screen window */
/* args to glViewport are left, bottom, width, height */
glViewport(0, 0, 500, 500);
/* NB: default viewport has same coords as in myinit, */