#include <windows.h>
#include <gl/gl.h>
#include <glut.h>
int pnsize = 0;
void display ()
{
glClearColor(0.0f,0.0f,0.0f,0.0f);
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
glPointSize(pnsize);
glBegin(GL_POINTS);
glColor3f(1.0f,0.0f,0.0f);
glVertex3f(0,0,0);
glEnd();
pnsize++;
if (pnsize == 100) pnsize = 0;
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();
}
|