www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: qjvictor on April 11, 2007, 11:01:07 PM

Title: a problem about the new version of JPCT
Post by: qjvictor on April 11, 2007, 11:01:07 PM
I just upgraded my horse race game to Jpct new version, everything looks good, except:
  previous I used a canvas as the content of a JFrame, like following,
     canvas = buffer.enableGLCanvasRenderer(IRenderer.MODE_OPENGL);
     this.getContentPane().add(canvas);
   now, because the method "enableGLCanvasRenderer" is not supported anymore, so I have to change into:
     buffer.enableRenderer(IRenderer.RENDERER_OPENGL, IRenderer.MODE_OPENGL);
     so there is no canvas anymore.
   But the problem is that when I try to close this webstart window, the close button on the top-right of the window doesn't work!!!
And I accessed the bluethunder, the demo webstart, the close button doesn't work either, I have to use keyboard to close this webstart window, but this is not a good way, I think.

So has anybody ever met such a problem and how to figure it out, I mean use new version.
Thanks.

Title: Re: a problem about the new version of JPCT
Post by: EgonOlsen on April 11, 2007, 11:06:00 PM
Quote from: qjvictor on April 11, 2007, 11:01:07 PM
...so I have to change into:
Into what? The method as well as it's signature hasn't changed. So were's the problem... ???
Title: Re: a problem about the new version of JPCT
Post by: qjvictor on April 11, 2007, 11:06:54 PM
haven't finished yet. sorry.
Title: Re: a problem about the new version of JPCT
Post by: EgonOlsen on April 11, 2007, 11:08:51 PM
Ok, no problem...well, as said: The signature hasn't changed. The enableGLCanvasRenderer is still present. About the closing of LWJGL "native" windows: That's right, you've to poll for a close request yourself. But that's another issue. The main question is, were the method is gone in your installation of jPCT... ???
Title: Re: a problem about the new version of JPCT
Post by: qjvictor on April 11, 2007, 11:16:07 PM
my fault, Olsen.
Sorry about that.
You can delete this thread.

BTW, new version is much better than the old one, especially you add an anti-alias function.
Title: Re: a problem about the new version of JPCT
Post by: EgonOlsen on April 11, 2007, 11:19:58 PM
Quote from: qjvictor on April 11, 2007, 11:16:07 PM
especially you add an anti-alias function.
On your request, if i remember correctly... ;)
Title: Re: a problem about the new version of JPCT
Post by: qjvictor on April 11, 2007, 11:24:46 PM
yes. it it.

And if I don't like use "canvas = buffer.enableGLCanvasRenderer(IRenderer.MODE_OPENGL);", I want to use "buffer.enableRenderer(IRenderer.RENDERER_OPENGL, IRenderer.MODE_OPENGL);",  so there is no canvas, not a JFrame, but a OpenGL window, how to close it?


Title: Re: a problem about the new version of JPCT
Post by: EgonOlsen on April 11, 2007, 11:30:56 PM
Just do a http://www.lwjgl.org/javadoc/org/lwjgl/opengl/Display.html#isCloseRequested() (http://www.lwjgl.org/javadoc/org/lwjgl/opengl/Display.html#isCloseRequested()).
Title: Re: a problem about the new version of JPCT
Post by: qjvictor on April 11, 2007, 11:33:07 PM
could you tell me some details? thx
Title: Re: a problem about the new version of JPCT
Post by: EgonOlsen on April 11, 2007, 11:39:44 PM
Not much details involved here...it's all static in Display, i.e. once you've enabled a GLRenderer, you have a lwjgl Display. Then you can do a Display.isCloseRequested() and if that returns true, somebody clicked on the little cross in the upper right corner. If this happens, act accordingly, i.e. dispose and disable the framebuffer, stop your game loop...whatever....
Title: Re: a problem about the new version of JPCT
Post by: qjvictor on April 11, 2007, 11:48:50 PM
Thanks. It works.