Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: doublebuffer cause flickering prolbem

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2006
    Posts
    6

    doublebuffer cause flickering prolbem

    Hi,

    i use doublebuffer mode to display data(swapbuffer),but the window become flickering. i guess the reason of flickering is that i used the swapbuffer command more than once,codes as following:

    draw some data....
    swapbuffer()

    draw another data...
    swapbuffer()
    if i only use the swapbuffers command once,the window is not flickering anymore, codes as following:

    draw some data...
    draw another data...
    swapbuffer()

    but my data is made of many layers(just like CAD layers),i want to display them layer by layer,so i used the swapbuffer commands more than once(i have to).

    anybody can help me ? Thanks

    Captain Wens

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: doublebuffer cause flickering prolbem

    Multiple implementations exists on swapbuffers(), typical one is that 2 buffers are used, and a pointer indicates which one is currently in use for drawing (the other is being displayed on screen).

    buffer A
    buffer B

    So no wonder it is flickering, you do :

    draw some data.... to buffer A
    swapbuffer()

    draw another data... to buffer B
    swapbuffer()

    etc.


    In general, you should assume that buffer content is undefined after each swapbuffer().


    but my data is made of many layers(just like CAD layers),i want to display them layer by layer,so i used the swapbuffer commands more than once(i have to).
    Not sure this is really what you need. Why no draw them all, in the wanted order ? Can you explain more precisely ?

  3. #3
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: doublebuffer cause flickering prolbem

    I found your other posts talking about drawing partial rendering : in this case, simply call glDrawBuffer(GL_FRONT_BUFFER) then draw your stuff, and call glFinish() after each layer.

  4. #4
    Junior Member Newbie
    Join Date
    Jan 2006
    Posts
    6

    Re: doublebuffer cause flickering prolbem

    Thanks,

    I tried the glDrawBuffer(GL_FRONT) method but the window was still flickering.

    the reason of the data contains many layers and i do not draw them all once is that, my data was made up of many different types such as 3d building , 3d roads ,3d pipes ,etc. draw them all once will cost about 400 ms(maybe more than 1 s ) , so i must draw them layer by layer and shows the dynamic rendering process.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •