I have a program, using opengl and GLX. At the beginning I choose a framebuffer configuration with the following attributes:
const int attributes[] = {GLX_RENDER_TYPE, GLX_RGBA_BIT, GLX_DOUBLEBUFFER, True, None};
fb_configs = glXChooseFBConfig(display, screen_index, attributes, &fb_configs_count);
When I have to re-render the window, I clear the screen, render the content and then swap the buffers:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
if_render();
glXSwapBuffers(display, drawable);
After I swap the buffers, instead of the contents of my window, I see what is behind the window. My guess is that the swapped buffer is in some initial state and nothing was actually rendered into it. If I trigger the buffer swapping for a second time, the content in my window is visualized properly.
Am I missing something?
EDIT
This happens with fluxbox 1.3.7 and mesa 11.0.6. I use a direct rendering context.