#include #include int i; float y; void display() { glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_LINE_STRIP); for(i=0;i<=10;i++) { y=sin((i-5)/5.0*3.14); glVertex2f((i-5)/5.0, y/3.14); } glEnd(); glFlush(); } int main(int argc, char *argv[]) { glutInit(&argc,argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutCreateWindow("C GLUT program"); glutDisplayFunc(display); glutMainLoop(); return 0; }