Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: wglShareLists question.

  1. #1
    Senior Member OpenGL Pro
    Join Date
    Aug 2000
    Location
    Portsmouth, Hampshire, England
    Posts
    1,063

    wglShareLists question.

    The wglShareLists function enables multiple OpenGL rendering contexts to share a single display-list space.

    BOOL wglShareLists(
    HGLRC hglrc1, // OpenGL rendering context with which to share
    // display lists
    HGLRC hglrc2 // OpenGL rendering context to share display lists
    );

    Parameters
    hglrc1
    Specifies the OpenGL rendering context with which to share display lists.
    hglrc2
    Specifies the OpenGL rendering context to share display lists with hglrc1. The hglrc2 parameter should not contain any existing display lists when wglShareLists is called.
    The amazing M$ documentation makes it virtually impossible for me to decide which bloody Rendering context it means for each paramter.

    Which is the original Rendering context (the one associated with the frame buffer when opening the window), rc1, or rc2?

    It looks like rc2 to me. That right?

    ta,
    Nutty

    [This message has been edited by Nutty (edited 10-01-2002).]

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Jun 2001
    Location
    Denmark
    Posts
    748

    Re: wglShareLists question.

    RC1 is the original one.

  3. #3
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421

    Re: wglShareLists question.

    Why does this matter? You should be able to swap them, no?

    V-man
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  4. #4
    Junior Member Newbie
    Join Date
    Sep 2002
    Location
    Townsville, Qld, Australia
    Posts
    12

    Re: wglShareLists question.

    Originally posted by V-man:
    Why does this matter? You should be able to swap them, no?

    V-man
    It matters if your creating textures in one context and sharing with another -- if you create in the second context (I think this is right... then normally the texture can't be used by the _first_ context because you haven't shared the resources of the second context...

    Ummm... I hope that's clear...

    Leathal.

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Feb 2001
    Location
    Switzerland
    Posts
    1,840

    Re: wglShareLists question.

    if i interpet it correctly, the second parameter is "source" and the first is "destiny"..

    but on the other hand, how about they both share their stuff together, so that each one has the others data.. then it wouldn't mather (i think thats what v-man ment..)
    http://davepermen.net - if i could stay true to my heart, i would feel totally free

  6. #6
    Member Regular Contributor
    Join Date
    Jul 2002
    Location
    Austria
    Posts
    280

    Re: wglShareLists question.

    I had to find out the hard way that the order actually matters. I had created a context with a couple of texture and program objects and then created a new context that should also have access to those objects. Of course, I accidentally called wglShareLists with the contexts swapped and was wondering why I didn't get any textures in the second context, even though I had just called wglShareLists before.
    So watch the parameter order with wglShareLists or it'll cost you hours of frustration, anger, and whatnot ;-)
    XEngine - The Platform- and API-Independent 3D Engine
    with Programmable Pipeline Support: [URL=http://xengine.sourceforge.net
    My]http://xengine.sourceforge.net

  7. #7
    Senior Member OpenGL Guru knackered's Avatar
    Join Date
    Aug 2001
    Location
    UK
    Posts
    3,032

    Re: wglShareLists question.

    I'm more interested in why you're using wglsharelists, nutty?
    Knackered

  8. #8
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,444

    Re: wglShareLists question.

    Saving texture memory I suppose, would be wasteful to upload the same textures to two different contexts.
    I always use wglShareLists when doing render to texture with WGL_ARB_render_texture.

  9. #9
    Senior Member OpenGL Guru knackered's Avatar
    Join Date
    Aug 2001
    Location
    UK
    Posts
    3,032

    Re: wglShareLists question.

    Yes, but you can use your main RC to render to the pbuffer - why use another+sharelists? Surely it would just cause an unnecessary stall as the new RC is switched to?
    Knackered

  10. #10
    Junior Member Regular Contributor
    Join Date
    Jan 2002
    Posts
    205

    Re: wglShareLists question.

    the pbuffer has its own device context, how do you do that?

Posting Permissions

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