1
Window / Re: Render and event loop in different threads?
« on: January 12, 2014, 02:24:58 pm »I'm not quite sure but I think I have read that you have to do the rendering in the thread you created the context(renderwindow). So try to do the eventhandling in the other thread.
I tried that, and the program aborted as soon as it received an event. However the error message gave me a hint, saying that I probably had forgotten to call XInitThreads first.
After I did that, it worked fine. Both creating the window in the "main" thread and then doing the rendering in a separate thread with event handling in the main thread, and doing the opposite (window creation and rendering in the main thread, while doing event handling in a new thread).
So if anyone wants to handle event-loop and rendering in different threads, remember to call XInitThreads before opening the window (I have it as the first call in the main function).