If you clear the color buffer and draw a triangle, you have nothing in the buffer that is shown in the screen and a triangle in the other buffer, so you have to swap buffers to show the triangle. If you swap buffers, you have a triangle in your screen and a empty color buffer in the other side. If you swap buffers again you should see and empty screen because you changed the buffer with the triangle by the other empty buffer. Instead of this, the triangle is shown again. Why?
If you swap buffers, you have a triangle in your screen and a empty color buffer in the other side.
No, you do not. Buffer swapping does not necessarily mean that the current contents of the front buffer are preserved. When you do a swap, the contents of the back buffer become the front buffer, but the state of the back buffer is undefined after the swap.
Some implementations use a true swap, where the two buffers really are switched. Other implementations copy the data from the back buffer on a swap, leaving the back buffer as whatever was there before. Still others could do something else.