Invalid X server connection specified

Started by doev, July 14, 2015, 14:24:15

Previous topic - Next topic

doev

If I init lwjgl3 in the main-thread and then use GLContext.createFromCurrent() in another thread, I get the error: "Invalid X server connection specified".

Is this still this issue?

https://github.com/LWJGL/lwjgl3/issues/39

Or am I doing something wrong?

spasi

Issue #39 should be fixed. Have you called glfwMakeContextCurrent in the secondary thread?

doev

Quote from: spasi on July 14, 2015, 15:06:08
Issue #39 should be fixed. Have you called glfwMakeContextCurrent in the secondary thread?

Yes, I have. Finally I only get it to work, when I setup lwjgl and the window in the same thread.

spasi

Quote from: doev on July 15, 2015, 11:42:46Yes, I have. Finally I only get it to work, when I setup lwjgl and the window in the same thread.

There is no such limitation. The only constraint is that GLFW initialization, window creation and event handling (i.e. glfwPollEvents()) must be done in the main thread. The contexts associated with the GLFW windows can be made current in other threads. See this example of how it can work in practice.

Could you post some code that triggers the "Invalid X server connection" error?

doev

Thank you for the example. Its working fine.