a problem about the new version of JPCT

Started by qjvictor, April 11, 2007, 11:01:07 PM

Previous topic - Next topic

qjvictor

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.


EgonOlsen

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... ???

qjvictor


EgonOlsen

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... ???

qjvictor

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.

EgonOlsen

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... ;)

qjvictor

#6
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?




qjvictor


EgonOlsen

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....