5
\$\begingroup\$

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

\$\endgroup\$
1
  • \$\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, 2016 at 19:44

1 Answer 1

2
\$\begingroup\$

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

\$\endgroup\$
1
  • \$\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, 2016 at 13:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .