I'm looking for a way to check if a thread accessing a namespace function has a OpenGL context attached to it. I have looked around and all I can find is,

GLFWwindow* glfwGetCurrentContext();

Which will return NULL if there is no context, but is there a better way?

I'm using OpenGL 4.5 and GLFW 3.2

  • \$\begingroup\$ Could you elaborate about your concern with glfwGetCurrentContext? What makes you believe something else would be "better"? What would "better" look like in your opinion? \$\endgroup\$ – Andreas Jul 3 '16 at 19:44

As far as I know that's the best solution to check if there is an active context.

| improve this answer | |
  • \$\begingroup\$ Thank's I was not too sure, It seems a little messy, but if it gets the job done, then that's all that matters :) \$\endgroup\$ – 0xen Jun 28 '16 at 13:00

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.