I know that I must pass glfwGetProcAddress
function to gladLoadGLLoader
function after context was initialized. GLFW documentation says that this function returns the address of the specified function for the CURRENT context. Based on this information, if I want to draw something on another context, I must type
glfwMakeContextCurrent(*window*)
gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)
each time I want to change drawing context. However, it is enough to simply change the context with glfwMakeContextCurrent
function. Documentation also remarks
The address of a given function is not guaranteed to be the same between contexts.
But it seems like returned addresses are the actually same between contexts (In windows, at least). The question is, what is true way to do this, in order to achieve stable and portable behaviour?