I am using Ubuntu 16.4 LTS with proprietary NVIDIA driver 384.111 and cannot get context sharing to work reliably.
In my own application, using glfw 3.1.1, a GL_INVALID_OPERATION error is triggered whenever accessing an object in a context different from the one it was create in. This error is only triggered when the first window is created with an OpenGL version above 3.1.
To see if this was specific to my application, I compiled and tested the sharing example in both glfw 3.1.1 and 3.2.1. However, an GL_INVALID_OPERATION is generated at glEnd() when drawing the quad, regardless of the OpenGL version. ThereforeI could not use the test as a reference.
Now I have two questions:
Was there a change in context handling between OpenGL version 3.1 and 3.2, or is this a bug in the driver/GLFW?
Is the context sharing bidirectional? From the GLFW documentation it is not clear whether it is only the first window(passed into the second glfwCreateWindow) which can access the other window’s objects.