Author Topic: GUI over JPCT  (Read 2942 times)

Offline chupakabra

  • byte
  • *
  • Posts: 7
    • View Profile
GUI over JPCT
« on: June 21, 2013, 09:16:39 am »
Hello,

I would like to add a couple of buttons on a JPCT application. Something like game menu.
What is the best way to achive this functionality?

I tried with TWL -http://l33tlabs.org/ and nifty-gui http://nifty-gui.lessvoid.com/, but with no success.
Is there an tutorial or example source code?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: GUI over JPCT
« Reply #1 on: June 21, 2013, 11:12:31 am »
Quote
...with no success...
That's a bit vague...what exactly does "no success" mean in this case?

Offline chupakabra

  • byte
  • *
  • Posts: 7
    • View Profile
Re: GUI over JPCT
« Reply #2 on: June 21, 2013, 11:26:36 am »
If I call
     Display.create();
my application stops responding(freezes).

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: GUI over JPCT
« Reply #3 on: June 21, 2013, 02:32:33 pm »
jPCT creates the Display by itself. There's no point in calling it again from within some other code. If you have to do that, because the GUI toolkit requires this, you can use this config setting: http://www.jpct.net/doc/com/threed/jpct/Config.html#glSkipInitialization, but you have to do the setup all by yourself then.

Offline chupakabra

  • byte
  • *
  • Posts: 7
    • View Profile
Re: GUI over JPCT
« Reply #4 on: June 24, 2013, 10:47:59 am »
First I got this problem:

LWJGLRenderer renderer = new LWJGLRenderer();
Caused by: java.lang.NullPointerException
   at org.lwjgl.opengl.GL11.glGetInteger(GL11.java:1436)
   at de.matthiasmann.twl.renderer.lwjgl.LWJGLRenderer.syncViewportSize(LWJGLRenderer.java:224)
   at de.matthiasmann.twl.renderer.lwjgl.LWJGLRenderer.<init>(LWJGLRenderer.java:125)

I've read, that I should call Display.create() or Display.makeCurrent();
In both cases, I get an exception.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: GUI over JPCT
« Reply #5 on: June 24, 2013, 11:05:07 am »
That's a GUI related question, i can't comment on that. All i can say is that jPCT creates the display by itself if you enable the gl renderer. You can skip this by using the Config-setting mentioned above.
« Last Edit: June 24, 2013, 01:49:57 pm by EgonOlsen »

Offline chupakabra

  • byte
  • *
  • Posts: 7
    • View Profile
Re: GUI over JPCT
« Reply #6 on: June 24, 2013, 01:35:41 pm »
Ok, I'll try to get some answers on their forums.

Thank you for your time.