LWJGL Forum

Programming => OpenGL => Topic started by: Cornix on July 25, 2013, 16:50:47

Title: How to make OpenGL work multithreaded?
Post by: Cornix on July 25, 2013, 16:50:47
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.
Title: Re: How to make OpenGL work multithreaded?
Post by: quew8 on July 25, 2013, 18:15:26
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.
Title: Re: How to make OpenGL work multithreaded?
Post by: Cornix on July 25, 2013, 18:31:18
I was kinda expecting this answer but I just wanted to be sure.
Thank you very much.