Color de Relleno

Iniciado por mapers, 7 Junio 2010, 05:25 AM

0 Miembros y 1 Visitante están viendo este tema.

mapers

Buenas gente del foro quisiera que me ayudaran a darle un relleno a mi figura yo le mando los parametros respectivos a cada vertice pero solo me  da el color de las lineas mas no el relleno a ver si me dan una manita aki les dejo mi codigo.....



Código (cpp) [Seleccionar]

#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();
}