#include <gl/glut.

h>

#include <stdio.h>

void graficar ()
{
//printf ("hola\n");
glClear(GL_COLOR_BUFFER_BIT); //LIMPIAR PANTALLA CON EL
COLOR EPECIFICADO EN INICIALIZAR
glColor3f(0,0,0);
glBegin(GL_POLYGON);

glVertex3f(0.35, 0.35, 0); //vertices
glVertex3f(0.45, 0.35, 0);
glVertex3f(0.55, 0.45, 0);
glVertex3f(0.45,0.55,0);
glVertex3f(0.35,0.55,0);
glVertex3f(0.25,0.45,0);

glEnd();

glColor3f(0,0,0);
glBegin(GL_LINE_LOOP);
glVertex3f(-0.25, 0.25, 0);
glVertex3f(-0.75, 0.25, 0);
glVertex3f(-0.75, 0.75, 0);
glVertex3f(-0.25, 0.75,0);

glEnd();

glFlush();
}
void inicializar()
{
glClearColor(1, 1, 1, 1); //ESPECFICACION DE COLOR solo para pantalla

}
int main (int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(500,500);
glutInitWindowPosition(100,100);
glutCreateWindow("hola mundo");

inicializar();
glutDisplayFunc(graficar); // registro de subprograma
glutMainLoop();
}