Jump to content
  • Advertisement
Sign in to follow this  
purpledog

OpenGL multi-threaded opengGL issue

This topic is 3828 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

Hi, it seems that I cannot call any opengl commands from another thread than the main one. Note that the main thread is only waiting for the auxiliary one when the error occur... Baiscally: - main thread, do some opengl GL work - start auxiliary thread, main thread is now waiting (in a clean openGL state) - then glGetError is returning an error after the first opengl call... If I don't catch this error I end up with a "run time check failure #0" - the value of ESP was not properly saved. If I run everything within the main frame, it's a ok... Any idea?

Share this post


Link to post
Share on other sites
Advertisement
If the main thread is going to be waiting, why bother putting all the effort into making a second thread? Just use the main thread.

Can you explain why you want this to be multi-threaded?

Share this post


Link to post
Share on other sites
Ok, looks like my answer:
http://www.equalizergraphics.com/documentation/parallelOpenGLFAQ.html#multicore

1. Using one Context from Multiple Threads

* Q: Why does my OpenGL application crash/not work when I am rendering from another thread?
* A: The OpenGL context is thread-specific. You have to make it current in the thread using glXMakeCurrent, wglMakeCurrent or aglSetCurrentContext, depending on your operating system.



rip-off, the scenario I described is a debug one, not something I intend to use.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!