Does freeglut allow you to draw in top of other?

I have white image. I am trying to draw another image in top of it.
But I cannot see it.
And is there a way to erase a drawing? Not from the code :stuck_out_tongue:

To “erase”, use glClear(GL_COLOR_BUFFER_BIT), and swap buffers if using double buffering.

But that deletes everything. However i want to delete just a single part. How can I do that?

You redraw everything except that part you don’t want to see anymore. This is how the vast majority of OpenGL applications operates.

true.
but what I am trying to do is let the user change the color of the object. Unfortunately, I could not learn picking. So, I thought i would use if statements like if x>122&& x< 213 return 1. same for y. So I would know which object was clicked. And then I called a popupmenu function for the user to choose color. Then I decided to redraw the colored object on top of other. If i erase all and draw again it will not work because I have different functions for drawing not colored things and colored things.
anyway I will try.
If you dont get this then I can provide a better explanation with code

If you want to do color picking, you have 2 choices. Either you use the back buffer or a RenderBuffer. Assuming you want to use the back buffer.

Whichever you choose, all you need to do is
glCear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENIL_BUFFER_BIT);
RenderObjectsWithUniqueColor();
//Read back color under the mouse
uint thecolor;
glReadPixels(x, y, 1, 1, GL_BGRA, GL_UNSIGNED_BYTE, thecolor);

//And clear again
glCear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENIL_BUFFER_BIT);
RenderObjects();
SwapBuffers();