Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 25 Jul 2013
Offline Last Active Aug 21 2013 08:25 AM

#5080386 wglMakeCurrent fails

Posted by gravitino on 25 July 2013 - 04:00 AM

I'd like to share a possible solution.


In my heavily concurrent application, I had the similar problems, though I had two possible error codes: ERROR_TRANSFORM_NOT_SUPPORTED or ERROR_INVALID_HANDLE, both appearing in an apparent in-deterministic manner, indicating a multithreading issue. I figured out that wglMakeCurrent ist *not* reentrant (at least when called on the same device context HDC, i didn't test the scenario when both, HDC and HGLRC, point to a different handle). By creating a spin-lock around wglMakeCurrent the problem disappeared for me.