Difference between single buffered(GLUT_SINGLE) and double buffered drawing(GLUT_DOUBLE)

后端 未结 2 2037
南笙
南笙 2020-12-15 02:22

I\'m using example here it works under

glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);

but it become a transparent window when I set it to

2条回答
  •  情话喂你
    2020-12-15 02:26

    When drawing to a single buffered context (GLUT_SINGLE), there is only one framebuffer that is used to draw and display the content. This means, that you draw more or less directly to the screen. In addition, things draw last in a frame are shown for a shorter time period then objects at the beginning.

    In a double buffered scenario (GLUT_DOUBLE), there exist two framebuffer. One is used for drawing, the other one for display. At the end of each frame, these buffers are swapped. Doing so, the view is only changed at once when a frame is finished and all objects are visible for the same time.

    That beeing said: Are you sure that a transparent window is caused by GL_DOUBLE and not by using GL_RGBA instead of GL_RGB?

提交回复
热议问题