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 3 of 3

Thread: swapbuffer, call in second thread ??

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2002
    Location
    ShenZhen.China
    Posts
    2

    swapbuffer, call in second thread ??

    hi all.
    in windows2000, i found the swapbuffer..
    are called not in main thread but another
    thread.
    i need to be notified when
    the swaping operation complete.
    so i can continue render new frame
    to backbuffer.
    how can i???

  2. #2
    Intern Newbie
    Join Date
    Mar 2002
    Posts
    39

    Re: swapbuffer, call in second thread ??

    Hi
    I think the nice way is to make a boolean variable true or false.
    I mean when u start drawing set
    bRendering = TRUE
    & when rendering is complete set
    bRendering = FALSE

    define & declare this variable as
    volatile BOOL bRendering=TRUE;

    call swap buffers if rendering is FALSE otherwise don't call it. Thats it

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2002
    Location
    ShenZhen.China
    Posts
    2

    Re: swapbuffer, call in second thread ??

    hi,
    i just wanna to know when the rending
    complete. see the following codes:

    glDrawSomething1(...);
    glFinish();
    SwapBuffers(hdc);
    glDrawSomething2(...);

    when call glDrawSomething2(..), i
    need be sure the Swapbuffers(hdc) has
    complete. because the SwapBuffers(hdc)
    call a new thread to copy backbuffer to
    front buffer, so i don't know when it
    complete.

Posting Permissions

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