We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › Can not destroy context while it is current??
Page Index Toggle Pages: 1
Can not destroy context while it is current???? (Read 1739 times)
Can not destroy context while it is current????
Feb 28th, 2010, 4:49pm
 
Hello, I'm developing an app using OpenGL in OSX 10.5, where I'm embedding a PApplet in a JFrame but keep getting this error:

Exception in thread "Animation Thread" javax.media.opengl.GLException: Can not destroy context while it is current

It doesn't happen if I run PApplet's Main. Have discovered that this isn't an uncommon problem but is there a solution to solving it???

Thanks again

Rich
Re: Can not destroy context while it is current????
Reply #1 - Mar 2nd, 2010, 2:51am
 
Hi, I have the same problem. Very annoying. I am trying to solve it now. I am developing in OSX 10.6 in Eclipse. I also embed a PApplet in a JFrame and use OpenGL. My application always works fine in OSX when running with Java 5 and with Java 6. In windows XP and windows 7 I get the error, but only when running with Java 6, with Java 5.21 it works fine. An older version of my application (from September 2009) does work fine in Windows XP with Java 6. I am now looking at the changes that I made (newer versions of processing, newer versions of opengl, other libraries that might conflict, code changes) but it is a lot of work and so far no luck.

Let me know if you have found a solution. Thanks.
Re: Can not destroy context while it is current????
Reply #2 - Mar 2nd, 2010, 4:41am
 
Hi, I managed to avoid this (for me Windows-only) error by going back from Processing 1.09 to 1.03. Or more precisely, by using the old core.jar, jogl libraries and jogl native libraries from Processing 1.03 in Eclipse.  The Processing 1.05 libraries still gave the error. I have not yet tried 1.04 (actually, I do not have 1.04).

I will probably not file this is a bug because processing in Eclipse is not officially supported. If somebody knows how to avoid the error with the latest Processing releases please post. Thanks.
Re: Can not destroy context while it is current????
Reply #3 - Mar 2nd, 2010, 7:51am
 
I think that the problem is introduced by the following change to Processing in 1.04:

Resizing window no longer distorts OpenGL graphics
http://dev.processing.org/bugs/show_bug.cgi?id=1176  


Because in this change the context is destroyed and that is what's mentioned in the error message.
Re: Can not destroy context while it is current????
Reply #4 - Mar 3rd, 2010, 9:13pm
 
That could be and more than likely is the problem, but it doesn't solve the immediate issue of the actual error, I've tried looking every where but just can't find a solution. Could this be reported to the developers of Processing so it can be fixed in the next release??? or is this a Mac only prob and will I have to sell my soul and start working on windows Sad It is pretty crucial that I find a solution in the next week as I have a very tight deadline for producing this prototype (21 march) and if I can't embed a PApplet into a JFrame using OpenGL then it could be a showstopper for processing and I'll have to go back to working directly with JOGL - which would be a pain (and a lot more code).

Thanks for every ones help

Rich
Page Index Toggle Pages: 1