Código
#include <GL/glut.h> void pintar() { glClear(GL_COLOR_BUFFER_BIT); glColor3d(0,1,0); glBegin(GL_POLYGON); glVertex2d(0.5,0.5); glVertex2d(-0.5,0.5); glVertex2d(-0.5,-0.5); glVertex2d(0.5,-0.5); glVertex2d(0.8,0.0); glEnd(); glFlush(); } int main(int argc, char* argv[]) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutInitWindowSize(400,400); glutInitWindowPosition(100,100); glutCreateWindow("Título de la ventana"); glClearColor(1,1,1,1); glutDisplayFunc(pintar); glutMainLoop(); return 0; }