Author Topic: a problem about the new version of JPCT  (Read 4392 times)

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
a problem about the new version of JPCT
« 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.

« Last Edit: April 11, 2007, 11:05:40 pm by qjvictor »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: a problem about the new version of JPCT
« Reply #1 on: April 11, 2007, 11:06:00 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... ???

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
Re: a problem about the new version of JPCT
« Reply #2 on: April 11, 2007, 11:06:54 pm »
haven't finished yet. sorry.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: a problem about the new version of JPCT
« Reply #3 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... ???

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
Re: a problem about the new version of JPCT
« Reply #4 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: a problem about the new version of JPCT
« Reply #5 on: April 11, 2007, 11:19:58 pm »
especially you add an anti-alias function.
On your request, if i remember correctly... ;)

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
Re: a problem about the new version of JPCT
« Reply #6 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?


« Last Edit: April 11, 2007, 11:30:48 pm by qjvictor »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
Re: a problem about the new version of JPCT
« Reply #8 on: April 11, 2007, 11:33:07 pm »
could you tell me some details? thx

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: a problem about the new version of JPCT
« Reply #9 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....

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
Re: a problem about the new version of JPCT
« Reply #10 on: April 11, 2007, 11:48:50 pm »
Thanks. It works.