I needed to be able to render from a thread and load images from another thread. so I googled a bit and found this:
https://www.khronos.org/opengl/wiki/OpenGL_and_multithreadingSo I implemented the first patch of code that u can see in that page, that is sharing a single context between two or more threads by letting one release it and acquire it in another thread, and it works perfectly.
The problem here is that I need to move the GL context from a thread to another several times per seconds, and as you may imagine this causes significant pauses in the rendering, given also the fact the context stays away from the rendering thread for a little bit less that a second (a long pause in the rendering). So I decided that I had to create two contexts so that the rendering never stops and I can load new stuff in the second thread, which is the second patch of code in the linked page,but I encountered several issues that I'm not familiar with:
-you use the wglShareList(long context1, long context2) method to share the context, but as far as I know there's no such object as a Context Obj in LWJGL, I just use Display.create() and thats it, so what argument should I use in there? Is it referring to Drawable object and/or SharedDrawable? (Which I have yet to understand what they are tbh);
-from where do I call the wglShareList method? I cant find it in GL11... GL41...neither of those;
I know it's and "old" topic but I cant find a solution.
Thanks