edges problem

Hi!
I’m beginner in opengl.
How can I draw a rectangle with its black edges and fill with red color?
or another primitive like disk or partial disk?
or how can i draw a red cube with its black edges?
I try to use glflagedges and glpolygonMode but i can’t view correctly
the edges?
i need some example, please!

thanks

You really need to draw it twice, once with

 
glPolygonMode ( GL_FRONT_AND_BACK, GL_FILL );

to draw your filled red cube.

And then

glPolygonMode ( GL_FRONT_AND_BACK, GL_LINES );

to draw your cube in wireframe, you’ll have to set the drawing colour to black…

Read up on PolygonOffset to, that could come in handy.

Paul Groves
pauls opengl page
paul’s opengl message board

And this work fine with flat (2D) nurbs surface?