Problems with culling

I get a strange behaviour using culling.
The piece of code below, print out a triangle drawn as points.
Why ???

...
glFrontFace(GL_CW);
glPolygonMode(GL_FRONT, GL_LINE);
glPolygonMode(GL_BACK, GL_FILL);
glCullFace(GL_FRONT);
glEnable(GL_CULL_FACE);
...
glBegin(GL_POLYGON);
  glVertex2f(100, 200);
  glVertex2f(200, 100);
  glVertex2f(350, 350);
glEnd();
...

Thanks in advance.

aptt

what are you trying to do?! if you want to cull back faces, why are you setting the polygon mode for them and why do you set the cull mode to cull front faces?! btw usually you want counter-clockwise polygons to be the front faces.

http://www.mevis.de/opengl/glPolygonMode.html
http://www.mevis.de/opengl/glCullFace.html

Originally posted by Vexator:
[b]what are you trying to do?! if you want to cull back faces, why are you setting the polygon mode for them and why do you set the cull mode to cull front faces?! btw usually you want counter-clockwise polygons to be the front faces.

http://www.mevis.de/opengl/glPolygonMode.html
http://www.mevis.de/opengl/glCullFace.html [/b]
I know what those routines do and the program has no a specific goal, I’m just trying to see what happen.

Theoretically in this example, the triangle could be drawn filled, lined or not drawn at all (depends on Cullface and FrontFace).

With the source above, I get points.
Why ???