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: Multiple PBuffers

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

    Multiple PBuffers

    Hi!
    I am trying to use multiple PBuffers (in WinXP), but they seem to interfere with each other.

    1. Do I have to supply a different HDC for wglCreatePbufferARB() each time I create another PBuffer?
    2. Why do I have to supply an HDC at all? I mean, PBuffers are meant for off-screen rendering in the first place.
    3. If I need multiple PBuffers and I must give a different HDC each time, is there a way to create those HDCs without constructing multiple dummy windows?

    Thanks!

  2. #2
    Junior Member Regular Contributor
    Join Date
    Sep 2005
    Posts
    105

    Re: Multiple PBuffers

    i never used pbuffers. but their main disadvantage is, that they need context and context switch when you want to render to them. i waited for FBO, look at that, its easy and portable

  3. #3
    Junior Member Regular Contributor execom_rt's Avatar
    Join Date
    Jul 2000
    Location
    Canada
    Posts
    237

    Re: Multiple PBuffers

    For one PBuffer, you need one HPBUFFERARB, one HDC and one HGLRC.

    Create the HPBUFFERARB from wglCreatePbufferARB.
    Pass the HPBUFFERARB to wglGetPbufferDCARB and it gives you the HDC.
    Pass the HDC to wglCreateContext and it gives you the HGLRC

    You can use wglShareLists to share the display lists and textures with the main HGLRC, although when switching context, you need to reset the OpenGL states (all your glEnable and other).

    Switch to your PBuffer with wglMakeCurrent.

Posting Permissions

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