Modern OpenGL and rendering to multiple windows


I’m having an issue. I’m creating a new window(second window) with its own OpenGL context, in the same way how I created the first one. I call SDL_GL_MakeCurrent before rendering anything to the second window and after rendering I swap the buffers for that window. Unfortunately nothing is being displayed on the second window. When I render the same content using exactly the same setup but with context of first window, its drawing it properly. I can only change clear color for the second window. Is there something that am I doing wrong or I forgot to set up?

Thank you.

I abandoned that for a while, but recently I’ve came back to that and found the issue. Maybe someone will be having the same problem. After creating a context for an another window you have to compile your shaders and load vertices again for that context. That solved it for me.