3
\$\begingroup\$

I have a few questions :

1 - What does it mean to make a context current? Does it mean that all subsequent OpenGL calls will apply to that context/window?

2 - With GLFW3, how to use multiple windows (say, 2)? Is it enough to create 2 windows/contexts, make the context current on the first one, draw things, then make the context current on the second window, and draw things?

3 - How does it all fit together with an OpenGL loading library (like gl3w)? When I initialize gl3w once after creating the contexts, will the OpenGL calls work on the context that is current even if I change it alot or will I have to re-initialize gl3w each time I make another context current?

\$\endgroup\$
1
\$\begingroup\$
  1. Yes. OpenGL is after all, a huge state machine.
  2. Yes. A later edit to specify an important thing: You SHOULD NOT use 2 OpenGL contexts to draw in multiple "spaces", but use a GUI-builder for in-game windows, such as Inventory or Character Stats.
  3. You do not have to re-initialize it every time. All you have to do is initialize gl3w inside the "pre-start" global function(just my preference, you can do it anywhere). After that, you can use OpenGL calls in any context. However, I recommend that you discard gl3w and use glbindings, as the latter offers C++11 support and A LOT more safety than gl3w.
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.