I am currently working on my game framework (c++, GLFW 3.3.2, OpenGL 4.4).
I would like to add to possibility to work with multiple windows. In that purpose, i start working with shared contexts.
So i created a ‘useless’ window that is hidden and that just deserves to share its context with any new ‘real’ windows (call this window FAKE1)
In my tests i created 2 other game windows as a proof of concept, sharing FAKE1 context (call them GAME1 and GAME2)
At first, this works fine, but as soon as i close one of the 2 games window the display collapses.
-I checked that before rendering GAME1 or GAME2 i set the concerned window’s context current
-I checked that before creating GAME1 or GAME2, the FAKE1 context is not current (as mentionned in glfwCreateWindow documentation)
-In my code, Textures et VertexBuffer are shared but not VertexArray (while such objects seem not to be sharable)
-The code is not multithreaded
The application i made is constantly allocating new resources. Is this an issue ?
Does the active context when a texture/buffer is beeing created of any concern ?
Must i always allocate resources with FAKE1 context ?
Can i create resources with GAME1 context active and use it inside GAME2 ? destroy it inside GAME2 ?
I am using glew to retreive OpenGL functions pointers. Can theses pointers be different between contexts ?
Thank you for your help.