I'm trying to use a different Thread for the whole WinAPI-Message-Loop stuff, so the window always keeps being responsive. Of course I'm using the main thread as the "window thread", because I need a context before loading textures etc. and I can't just call Get/PeekMessage for a different thread.
Now there are a few things I'm wondering about though:
- Can I use the OpenGL context handle from a different thread? I'm relatively sure I can since otherwise there would be no way to do multi-threaded rendering, but maybe there's more to it.
- At some point I have to call SwapBuffers() from inside the render loop - that means in this case, from a different thread. Can I just use the HDC I usually use? Is this handle thread-safe? I'm not so sure about that, but I can't really find a definitive answer on the subject.
If the answer is no, what would be a good method to deal with the issue? Maybe I can send a message from the render-thread?