Jump to content
  • Advertisement
Sign in to follow this  
rumble

OpenGL Error callbacks, invalid operation, and threads

This topic is 3637 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Calling glGetError(), I am getting error code 0x502 (GL_INVALID_OPERATION) at the beginning of a function prior to its openGL calls. The code is multi-threaded and each thread starts this function. While the first thread I do not get this error, the second and third threads I do. And because of threads, I cannot go up much higher on the call stack to see where there would have been no error. I don't recall a call back in OpenGL; wonder if there are other ways to debug. Thanks

Share this post


Link to post
Share on other sites
Advertisement
In OpenGL, each thread has it's own context. It may workt to call MakeCurrent on the context in each thread before any other GL calls. For ultimate safety, serialize access to the GL through a single rendering thread.

Share this post


Link to post
Share on other sites
It's not such a good idea to multithread and call wglMakeCurrent from each thread. It will reduce performance. Do all GL calls from 1 thread.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!