Results 1 to 2 of 2

Thread: contexts, wglsharelists & textures...

  1. #1
    Member Contributor
    Join Date
    Jul 2006

    contexts, wglsharelists & textures...

    I have an application which uses two top level windows for rendering in a multi monitor configuration. I need to be able to switch to and from fullscreen mode (ChangeDisplaySettingsEx) on both monitors. My understanding (from Nehe) is that I need to set fullscreen mode before creating the windows, which means I must destroy and recreate each window for each mode change, which also means I must destroy and recreate opengl contexts for each window. This implies that I must reload all textures upon mode change.

    Firstly, would a reasonable strategy be to create a third hidden window (maybe 1x1 pixel) and use this to share textures with the two visible windows? This would remove the need to reload textures at each mode change.

    Secondly, using wglShareLists, does it matter which context is current when creating the shared textures? For example...

    dummyContext (hidden, shares it's resources)
    window1Context (get recreated on mode change)
    window2Context (get recreated on mode change)

    wglShareLists( dummyContext, window1Context);
    wglShareLists( dummyContext, window2Context);

    ...if I make current the dummy context and create a new texture it will be shared with both window contexts - that's fine. However, if, for example, window1Context is the current context when I create a new texture will it be visible to window2Context? Or should I always switch back to the dummy context when creating textures?

    Many thanks.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Nov 2003
    Czech Republic

    Re: contexts, wglsharelists & textures...

    textures are "visible" in all shared contexts.
    It doesn't matter in which context the texture was
    created. So yes, if you create texture in win1ctx it will be available in win2ctx.

Similar Threads

  1. Sharing textures between contexts
    By drifter in forum OpenGL: Linux
    Replies: 4
    Last Post: 08-19-2014, 04:53 AM
  2. wglShareLists and current contexts
    By Taicoon in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 05-07-2010, 03:34 AM
  3. wglShareLists - Sharing textures between rendering
    By Spyer in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 11-08-2008, 03:21 PM
  4. Sharing Textures Between OpenGL Contexts
    By coolguyclay in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 10-30-2008, 04:21 PM
  5. Replies: 2
    Last Post: 07-03-2003, 02:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean