From: Michael N. <ze...@mo...> - 2002-02-10 14:38:50
|
hi there, every time quitting my GL4Java apps, I got the following error Message: 'gljDestroy failed (freee)' what am I doing wrong ? greetings -Michael Nischt -------------------------------------------------------------------------= ----------- display starts with: if (glj.gljMakeCurrent() =3D=3D false) return; display ends with: glj.gljSwap(); =20 glj.gljCheckGL(); =20 glj.gljFree(); windowClosing starts with: canvas.stop(); =20 canvas.cvsDispose(); -------------------------------------------------------------------------= ----------- |
From: <lec...@ya...> - 2003-02-08 16:25:21
|
Already posted on the forum, but don't know if it's still alive... Anyway, "gljDestroy failed (free)", who knows what it does mean ? I have a JFrame containing a GLAnimCanvas called "canvas", created with GLDrawableFactory.getFactory().createGLAnimCanvas(caps, 640, 480); Then, i add a GLEventListener (canvas.addGLEventListener) on it, containing all the init and display methods. But everytime I try to call canvas.cvsDispose(), it tells me that gljDestroy Failed. I know that it means he can't destroy the GLContext, but i dunno how to correct it... When I Use a simple GLAnimCanvas, without GLEventListener, this error never occur. Is it a GLEventListener problem ? Or am i doing something wrong ? ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com |
From: Gary S. <gi...@st...> - 2003-02-10 14:06:20
|
> Anyway, "gljDestroy failed (free)", who knows what it > does mean ? > > I have a JFrame containing a GLAnimCanvas called > "canvas", created with > GLDrawableFactory.getFactory().createGLAnimCanvas(caps, > 640, 480); > > Then, i add a GLEventListener > (canvas.addGLEventListener) on it, containing all the > init and display methods. But everytime I try to call > canvas.cvsDispose(), it tells me that gljDestroy > Failed. I know that it means he can't destroy the > GLContext, but i dunno how to correct it... > > When I Use a simple GLAnimCanvas, without > GLEventListener, this error never occur. Is it a > GLEventListener problem ? Or am i doing something > wrong ? I don't know exactly what it means but I do know where it occurs. Basically, as I'm sure you know, since the event that terminates the main window can be called at any time, then the GLAnimCanvas can be within a draw() at the time the termination is called, this causes this error to appear. The way I got around it was to insure the termination occured correctly from within the draw. For example if you have a window close event this can set a boolean flag within the canvas which if found to be true terminates the application (so effectively your canvas is responcable for terminating the application). You could also maybe set up an event listener inside the canvas to stop the OpenGL drawing. Hope this helps, Gary |
From: <lec...@ya...> - 2003-02-17 10:11:34
|
I tried to do what you said, but there one thing I must be missing, because I don't know how to insure that the termination comes from the canvas. I tried to do it inside a windowClosed event, but it doesn't work... The main problem I have is to stop the GL drawing ! Have you any source code example ? Thanks --- Gary Stewart <gi...@st...> a écrit : > > Anyway, "gljDestroy failed (free)", who knows what > it > > does mean ? > > > > I have a JFrame containing a GLAnimCanvas called > > "canvas", created with > > > GLDrawableFactory.getFactory().createGLAnimCanvas(caps, > > 640, 480); > > > > Then, i add a GLEventListener > > (canvas.addGLEventListener) on it, containing all > the > > init and display methods. But everytime I try to > call > > canvas.cvsDispose(), it tells me that gljDestroy > > Failed. I know that it means he can't destroy the > > GLContext, but i dunno how to correct it... > > > > When I Use a simple GLAnimCanvas, without > > GLEventListener, this error never occur. Is it a > > GLEventListener problem ? Or am i doing something > > wrong ? > > > I don't know exactly what it means but I do know > where it occurs. > Basically, as I'm sure you know, since the event > that terminates the main > window can be called at any time, then the > GLAnimCanvas can be within a > draw() at the time the termination is called, this > causes this error to > appear. The way I got around it was to insure the > termination occured > correctly from within the draw. For example if you > have a window close > event this can set a boolean flag within the canvas > which if found to be > true terminates the application (so effectively your > canvas is responcable > for terminating the application). You could also > maybe set up an event > listener inside the canvas to stop the OpenGL > drawing. > > Hope this helps, > > Gary > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = > Something 2 See! > http://www.vasoftware.com > _______________________________________________ > gl4java-usergroup mailing list > gl4...@li... > https://lists.sourceforge.net/lists/listinfo/gl4java-usergroup ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com |
From: Gary S. <gi...@st...> - 2003-02-17 14:43:37
|
On Mon, 17 Feb 2003, oO=D5 --- Le Castor --- =D5Oo wrote: > I tried to do what you said, but there one thing I > must be missing, because I don't know how to insure > that the termination comes from the canvas. I tried to > do it inside a windowClosed event, but it doesn't > work... > Yeah, I think I might have been smoking something when I wrote that :). My actual final solution was to put the window closing inside the same class that I do all my drawing from (so the class that extends GLAmimCanvas). So say you have the class Game which is the main canvas (and does all the drawing) then you get: public class Game extends GLAnimCanvas implements =09=09=09=09=09java.awt.event.WindowListener =09{ public void windowClosed(WindowEvent e) { System.exit(0); } public void windowClosing(WindowEvent e) { System.exit(0); } =09/**And the rest of your functions*/ } (window closing is always called first so it should never get to closed). anyway so you create your frame add the canvas to it and then add the event listener like: frame.addWindowListener(Game.getInstance()); where the reference is the currently active canvas frame (my program uses the singleton pattern). You can also terminate things safely using the key listeners and such like. I hope this helps, Gary |
From: <joh...@ae...> - 2003-04-14 12:21:30
|
I get the error 'gljDestroy failed (free)' everytime I try to close my = application. I've searched for this error on google but I haven't seen any good = answer yet. What do I need to do to get it to work? My display function looks like this: public void display() { glj.gljMakeCurrent(); =20 ... ... ... glj.gljSwap(); glj.gljFree(); } I read in GL4Java's documentation that you should call gljfree before = gljDestroy so I've overridden doCleanup like this: public void doCleanup() { glj.gljFree(true); super.doCleanup(); } But that didn't help. Hope someone can help me. |
From: <aco...@mi...> - 2003-04-14 13:25:42
|
Hi, We were having the problem with OpenMind. I think this comes from the fact the GLContext is already managed by gl4java in class GLAnimCanvas and GLCanvas, and though GLContext management appears in almost every gl4java example, managing it results in this error, because you make a new call to these methods while they have just been called by -say- the GLAnimCanvas.display() method, and while the context hasn't been released yet, you are trying to make it current again. I don't have a very good understanding of glContext management and multithreading but this how I have solved this problem with OpenMind, after having tested various combinations of code : public void init(GLDrawable drawable) { glj.gljMakeCurrent(); =20 =20 // init code goes here =20 =20 glj.gljFree(); firstRun=3Dtrue; =20 } public void display(GLDrawable drawable) { if(firstRun){ glj.gljMakeCurrent(); firstRun=3Dfalse; } =09 // display code goes here =09 // notice there is no gljFree() here and gljMakeCurrent()=20 // is only called at the first run =20 =20 } public void cleanup() { // making context current prevents VM crash in nvogl.dll=20 // for Nvidia cards when calling glDeleteTextures glj.gljMakeCurrent();=20 // your cleanup code goes here glj.gljFree(); } public void reshape(int width, int height) { glj.gljMakeCurrent(); =09 // your reshape code goes here =20 glj.gljFree(); } This structure for the main loop fixes the gljDestroy failed (free) error message, and VM crash on cleanup when using NVidia cards. Regards, Alban -----Message d'origine----- De=A0: gl4...@li... [mailto:gl4...@li...] De la part de =D6berg Johan Envoy=E9=A0: lundi 14 avril 2003 14:21 =C0=A0: gl4...@li... Objet=A0: [gl4java-usergroup] gljDestroy failed (free) I get the error 'gljDestroy failed (free)' everytime I try to close my application. I've searched for this error on google but I haven't seen any good answer yet. What do I need to do to get it to work? My display function looks like this: public void display() { glj.gljMakeCurrent(); =20 ... ... ... glj.gljSwap(); glj.gljFree(); } I read in GL4Java's documentation that you should call gljfree before gljDestroy so I've overridden doCleanup like this: public void doCleanup() { glj.gljFree(true); super.doCleanup(); } But that didn't help. Hope someone can help me. ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ gl4java-usergroup mailing list gl4...@li... https://lists.sourceforge.net/lists/listinfo/gl4java-usergroup |
From: <lec...@ya...> - 2003-04-14 17:05:30
|
I see that everyone on earth who is using GL4Java encounters this error... ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com |