Código
#include<windows.h> #ifdef __APPLE__ #include <GLUT/glut.h> #else #include <GL/glut.h> #endif #include <stdlib.h> void display(void) { glClearColor(0.0,0.0,0.0,0.0); glClear(GL_COLOR_BUFFER_BIT); glOrtho(-5.0,5.0,-5.0,5.0,-5.0,5.0); glBegin(GL_LINE_LOOP); glColor3f(1.0f,0.0f,0.0f); glVertex2f(4.0,0.0); glVertex2f(2.0,1.0); glVertex2f(2.0,2.0); glVertex2f(1.0,2.0); glVertex2f(0.0,4.0); glVertex2f(-1.0,2.0); glVertex2f(-2.0,2.0); glVertex2f(-2.0,1.0); glVertex2f(-4.0,0.0); glVertex2f(-2.0,-1.0); glVertex2f(-2.0,-2.0); glVertex2f(-1.0,-2.0); glVertex2f(0.0,-4.0); glVertex2f(1.0,-2.0); glVertex2f(2.0,-2.0); glVertex2f(2.0,-1.0); glVertex2f(4.0,0.0); glEnd(); glFlush(); glutSwapBuffers(); } int main() { glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGB); glutInitWindowSize(400, 400); glutInitWindowPosition(200, 200); glutCreateWindow("Estilos de Lineas"); glutDisplayFunc(display); glutMainLoop(); }