Login  Register

Hello! and Error: ...incorrectly used with a different GLContext...

Posted by LordSmoke on Jun 10, 2016; 10:11pm
URL: https://forum.jogamp.org/Hello-and-Error-incorrectly-used-with-a-different-GLContext-tp4036820.html

Hello, Folks! It has been a while. Two years, in fact, since I have been able to do any jogl programming. I only have blocks of time for immersive programming during my teaching visits to Vienna, and last year I had a bunch of lectures and workshops that precluded that.

However, my student, Lili, did a great job (with your generous help) of building a jogl API to my specs that I am now incorporating into my software package. I have almost all the tools to draw into a jogl canvas such that I can concentrate on the higher-level functions.

I do have one, I hope easily answered, question.

I have several JTabbedPane windows (random shapes, regression, principal components, etc.) with different GLCanvases within them. In one that I am using to familiarize myself has a simply timer that generates and plots random shapes in random sizes, locations, colors. Very robust, except that when I switch from on GLCanvas pane to another, the timer call to canvas.display() generates the error:

Exception in thread "AWT-EventQueue-0" com.jogamp.opengl.GLException: Caught GLException: This GL object is being incorrectly used with a different GLContext than that which created it on thread AWT-EventQueue-0

I am guessing I should save/reset the GLContext to the one for the particular window or canvas and this would only require a simple line or two of code if I knew what they were.

Comments? Suggestions?

TIA, LS