Jump to content

  • Log In with Google      Sign In   
  • Create Account


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

#5080386 wglMakeCurrent fails

Posted by 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.