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: wglMakeCurrent() ???

  1. #1
    Intern Newbie
    Join Date
    Apr 2004
    Posts
    45

    wglMakeCurrent() ???

    i have some problems using pbuffer .. no problem to create it .. but i get wrong results while switching between pbuffer and frame buffer .. for testing i'm calling

    wglMakeCurrent(wglGetCurrentDC(), wglGetCurrentContext());

    before every rendering .. and i though it would just render my screen to the current window .. but it looks wrong .. the other mysterious thing happens after calling twice wglMakeCurrent() .. normaly i tought i should get the same result as calling only ones ..

    wglGetCurrentContext(..));
    render();

    is different from

    wglGetCurrentContext(..));
    wglGetCurrentContext(..));
    render();

    .. perhaps i misunderstood something basicly .. would be great if somebody could help me ..

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,411

    Re: wglMakeCurrent() ???

    Note that a pbuffer typically doesn't share context with a window. Thus, you have to use wglShareLists() to make textures and display lists come across. You also have to re-apply whatever state you might think transfers between frames, because it might retain whatever the state was last left in when it was last current.

    Also, if you just MakeCurrent on the current DC and RC, then that doesn't actually change what's current. You should MakeCurrent your pbuffer DC and RC to draw into pbuffer, and then MakeCurrent your window DC and RC to come back.
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

Posting Permissions

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