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?
Issue #39 should be fixed. Have you called glfwMakeContextCurrent in the secondary thread?
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.
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 (https://github.com/LWJGL/lwjgl3/blob/master/modules/core/src/test/java/org/lwjgl/demo/glfw/Threads.java) of how it can work in practice.
Could you post some code that triggers the "Invalid X server connection" error?
Thank you for the example. Its working fine.