Those who can, do. Those who can't, simulate Concept 1.1 : Clearing The Window ================================== Idea: ===== We took a brief look at changing the background color while learning Concept1.4. We try to understand the theory here. On a computer, the memory holding the picture is usually filled with the last picture you drew, so typically one need's to clear it to some background color before one start's to draw the new scene. As an example, these lines of code clear an RGBA mode window to black: glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); The first line sets the clearing color to black, and the next command clears the entire window to the current clearing color. The single parameter to glClear() indicates which buffers are to be cleared. In this case, the program clears only the color buffer, where the image displayed on the screen is kept. Typically you set the clearing color once, early in your application. At this point, it would not be a bad idea to review some of the examples in Chapter1 to see how the above lines of code are positioned with regards to the overall structure of the program. Also other buffers might be encountered in your experience. Some other buffers are the depth buffer specified as GL_DEPTH_BUFFER_BIT. Listed below are common buffers : ==================================================== Buffer Name ==================================================== Color GL_COLOR_BUFFER_BIT Depth GL_DEPTH_BUFFER_BIT Accumulation GL_ACCUM_BUFFER_BIT Stencil GL_STENCIL_BUFFER_BIT ----------------------------------------------------- Before issuing a command to clear multiple buffers, you have to set the values to which each buffer is to be cleared. Further you can clear multiple buffers by logically "OR'ing" them in the glClear() command: glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);