#include void display() { glClearColor(1, 1, 1, 0); glClear(GL_COLOR_BUFFER_BIT); glColor3ub(128, 128, 128); glBegin(GL_LINES); glVertex2f(-240, 0); glVertex2f(240, 0); glEnd(); glutSwapBuffers(); } int main(int argc, char** argv) { glutInit(&argc, argv); glutInitWindowPosition(200, 50); glutInitWindowSize(480, 360); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); glutCreateWindow("OpenGL"); gluOrtho2D(-240, 240, -180, 180); glutDisplayFunc(display); glutMainLoop(); return 0; }