#include <windows.h>
#include <gl/gl.h>
#include <glut.h>
void display ()
{
glClearColor(0.0f,0.0f,0.0f,0.0f);
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
for (float y = - 10.0f; y < 10.0f;y += 0.1f)
{
glBegin(GL_LINES);
glVertex3f(-0.9,y, 0.0);
glVertex3f(0.9, y, 0);
glEnd();
}
glutSwapBuffers();
}
void reshape ( int w, int h )
{
glViewport( 0, 0, w, h );
glMatrixMode (GL_PROJECTION);
gluPerspective(80,( float ) w / ( float ) h, 1.0, 1000.0 );
}
void keyboard ( unsigned char key, int x, int y )
{
if (key == 27) exit(0);
}
int main ( int argc, char** argv )
{
glutInit( &argc, argv );
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE );
glutInitWindowSize (500, 500 );
glutCreateWindow ( "point" );
glutDisplayFunc( display );
glutReshapeFunc( reshape );
glutKeyboardFunc( keyboard );
glutIdleFunc( display );
glutMainLoop();
}
|