Sharing the objects created at first window by all other windows

When working with multiple windows environment, I am creating all the resources (texture, buffers, etc.) at the first window creation and would like to share them with the rest of the windows. The last parameter of command glfwCreateWindow is for context sharing and the newly created window can share its resources with the window specified at the last parameter, whereas in my case it’s the opposite, I want the newly created window to get resources from the primary or first window.


Hi @PrashantSaxena ,

Context sharing works both ways, so you can achieve what you need with creating the new windows with share being the first window.

If you look at the GLFW sharing.c example you will see that it creates objects with the first window’s context and then uses them with the second.