Jump to content
  • Advertisement
Sign in to follow this  
m_gnu_

One context, several windows

This topic is 3814 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

have an application with multiple windows and after some heavy struggling with sharing stuff between contexts (wglShareLists) I stumbled across this on msdn (http://msdn2.microsoft.com/en-us/library/ms537526(VS.85).aspx): "A current rendering context has an associated device context. That device context need not be the same device context as that used when the rendering context was created, but it must reference the same device and have the same pixel format." I tried it, and it seems to work perfectly. I simply create one RC for my first DC and then I use the same RC for all the DC:s which I create later. I no longer have to share stuff with wglShareLists, because everything now belongs to the same RC. Are there any pifalls here which I have missed? I guess there might be, since I've never heard of anyone doing like this before. All I've ever read is that I should create as many RC:s as I have windows...

Share this post


Link to post
Share on other sites
Advertisement
Well, you just need to make sure to make GL current, make GL calls, then make it non current : wglMakeCurrent(NULL, NULL)
in each function.
Performance won't be ideal when you have more than 1 GL window but I think it should be fine for you.

There isn't much else.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!