There is definitely something fishy with the contexts, It seems like there's a swap of context after the Window is created that might cause this issue. And it would be very handy to know what triggers the swap before we make GL calls.
gDEBugger returns:
Debug String: Detected error: The debugged process asked for an extension function pointer (glCreateProgram) from one render context, but called this function pointer in another render context (context #3)
Debug String: Detected error: The debugged process asked for an extension function pointer (glBindAttribLocation) from one render context, but called this function pointer in another render context (context #3)
Debug String: Detected error: The debugged process asked for an extension function pointer (glCreateShader) from one render context, but called this function pointer in another render context (context #3)
Debug String: Detected error: The debugged process asked for an extension function pointer (glShaderSource) from one render context, but called this function pointer in another render context (context #3)
SNIP...
OpenGL Render Context 3 Deleted
Debug String: Detected error: The debugged process asked for an extension function pointer (glDeleteBuffers) from one render context, but called this function pointer in another render context (context #2)
Debug String: Detected error: The debugged process asked for an extension function pointer (glUseProgram) from one render context, but called this function pointer in another render context (context #2)
Debug String: Detected error: The debugged process asked for an extension function pointer (glDetachShader) from one render context, but called this function pointer in another render context (context #2)
Debug String: Detected error: The debugged process asked for an extension function pointer (glDeleteShader) from one render context, but called this function pointer in another render context (context #2)
Debug String: Detected error: The debugged process asked for an extension function pointer (glDeleteProgram) from one render context, but called this function pointer in another render context (context #2)
It would help if:
- The dummy contexts could be destroyed leaving only the main one... or
- We could track which context is the main one (the one that uses glswapbuffers) and/or...
- A way to set the main context active before making gl calls. (I'm guessing that is "set active window" but it does not seems to do any good here).