I have a program that has an OpenGL window to draw various things in it. At the same time, I am doing offscreen rendering to get image masks.
Each one of them has a separate OpenGL context that they draw to. The offscreen rendering is called regularly, say every second.
What happens is that the offscreen context does not "switch back" the default context to the GUI context, so I end up drawing things to the GUI from offscreen.
What's a way of telling OpenGL "use this other context from this moment on" ?