How to make OpenGL work multithreaded?

Started by Cornix, July 25, 2013, 16:50:47

Previous topic - Next topic

Cornix

Hi guys.

Just out of curiousity, is there a good way to make the drawing with openGL multithreaded to gain performance?
I personally cant imagine it because it would be quite confusing to send vertex data to the graphics card from multiple individual threads, but maybe there is something I dont know yet.

Its not like I need it right now, the performance is fine right now, but I am curious how one could do it if its possible.
And then, of course, how to do it right in Java with LWJGL.

Thanks in advance.

quew8

It isn't possible to multithread OpenGL for exactly the reasons you stated. If you try and call any OpenGL function from any thread other than the one you made the OpenGL context on, you'll get an exception.

Cornix

I was kinda expecting this answer but I just wanted to be sure.
Thank you very much.