#include <GL/glut.h>

void display_func()
{
glClearColor(1., 0., 0., 1.); /* Red */
glClear(GL_COLOR_BUFFER_BIT);
}

void keyboard_func(unsigned char key, int x, int y)
{
if (key=='\e') /* ESC */
   exit(0);
}

int main(int argc, char* argv[])
{
glutInit(&argc, argv);
glutCreateWindow("Hello GLUT!");
glutDisplayFunc(display_func);
glutKeyboardFunc(keyboard_func);
printf("Press Esc to end.\n");
glutMainLoop();
return 0;
}
