thanks and regards,
Apurv
I may be missing something in your description, but it sounds like you
want glClearColor.
OpenGL does NOT keep track of your primitives for you.* This means that you need to keep track of them on your own.
--
Andy V
* Well, you can use display lists to get OpenGL to remember primitives. Have display() call display list 1 (which is not yet defined). When you add the first object (line segment or whatever), put its primitives in display list 1 and end it with a call to display list 2. The next object goes in display list 2, plus the call to display list 3. To make things a bit easier for the implementation, you can build multiple objects into a single display list rather than use one list per object. In the modern OpenGL era, this is considered poor style and restricts you to implementations that support display lists.
glClearColor(0,0,0,0) would clear the entire screen to black and not
preserve whatever was drawn on it. I just want the background to be
changed to some other color.
how about to change the color values? (0,0,0,0) as RGBA in a range of
0.0 - 1.0f
> glClearColor(0,0,0,0) would clear the entire screen to black and not
> preserve whatever was drawn on it. I just want the background to be
> changed to some other color.
OpenGL is not a scene graph. You can't change individual things after
drawing a scene, because that's not the way OpenGL works. You want
something changed, you redraw the whole scene. You want to change the
background color: You redraw the whole scene, starting with a clear,
but clear to the new desired background color.
Wolfgang
I think this should be the first sentence in any OpenGL intro (with
suitable explanation)... :]
When I was learning OpenGL, this was the key realization for me --
before that I was just soooo confused; afterwards I was still
confused, but suddenly tons of stuff made sense where they didn't
before, and I could actually start making some progress in learning...
-Miles
--
Any man who is a triangle, has thee right, when in Cartesian Space,
to have angles, which when summed, come to know more, nor no less,
than nine score degrees, should he so wish. [TEMPLE OV THEE LEMUR]