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

Thread: wglCopyContext between pbufffers?

  1. #1
    Junior Member Newbie
    Join Date
    May 2004
    Posts
    1

    wglCopyContext between pbufffers?

    I have two pbuffers with the same pixel format. I create the first pbuffer first and setup rendering states. Right after the sencond pbuffer is created (before it is made current), I calls
    wglCopyContext(pbuffer_1.hrc, pbuffer_2.hrc, GL_ALL_ATTRIB_BITS). In NVidia card, it crashes. In ATI Radeon 9600XT, it didn't crash, but the texture in second pbuffer is gone no matter how I enable and load the texture when second pbuffer is made current. If I comment out wglCopyContext, everything works fine except that I have to setup rendering state again.

    Any one has any experience on wglCopyContext?
    Thanks!

  2. #2
    Advanced Member Frequent Contributor plasmonster's Avatar
    Join Date
    Mar 2004
    Posts
    750

    Re: wglCopyContext between pbufffers?

    From the MSDN library:

    Using the wglCopyContext function, you can synchronize the rendering state of two rendering contexts. You can only copy the rendering state between two rendering contexts within the same process. The rendering contexts must be from the same OpenGL implementation. For example, you can always copy a rendering state between two rendering contexts with identical pixel format in the same process.

    You can copy the same state information available only with the glPushAttrib function. You cannot copy some state information, such as pixel pack/unpack state, render mode state, select state, and feedback state. When you call wglCopyContext, make sure that the destination rendering context, hglrcDst, is not current to any thread.
    Hope this helps.

Posting Permissions

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