title: Multithreaded Rendering on OpenGL
body: <p>I have a multithreaded application, in which I'm trying to render with different threads. First I tried to use the same Rendering Context between all threads, but I was getting NULL current contexts for other threads. I've read on the internet that one context can only be current at one thread at a time.</p>
  
  <p>So I decided to make something different. I create a window, I get the HDC from it and create the first RC. AFter that, I share this HDC between threads, and in every new thread I create I obtain a new RC from the same HDC and I make it current for that thread. Everytime I do it, the RC returned is always different (usually the previous value + 1). I make an assertion to check if <code>wglGetCurrentContext()</code> returns a RC, and it looks like it returns the one that was just created. But after making the rendering, i get no rendering and if I call <code>GetLastError()</code> I obtain error 6 (invalid handle??)</p>
  
  <p>So, does this mean that, despite every new call of <code>wglCreateContext()</code> gives me a new value, somehow it means that all these different values are the same "Connection channel" to the OpenGL calls?</p>
  
  <p>Does this mean that I will always have to invalid the previous Rendering Context on a thread, and activate it on the new one? I really have to make this sync all the time or is there any other way to work arround this problem?</p>