My application has two threads: A and B. The A is the main thread and B is my video thread. The video thread has an initialized OpenGL context where OpenGL functions work properly. However, when I call OpenGL functions from thread A, the function failed with a 1282 error (GL_INVALID_OPERATION) Is it possible to call OpenGL functions from my main thread (A) ?
Unless you are doing actual background rendering of slow content, this is probably not going to give you a performance delta.
On Windows, open gl contexts are per thread. Ensure that you call wglMakeCurrent from your worker thread before attempting to call open gl functions.
Open GL is not thread safe. If you attempt to make the same context current on multiple threads, it won't stop you. It will just explode.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With