GUI over JPCT

Started by chupakabra, June 21, 2013, 09:16:39 AM

Previous topic - Next topic

chupakabra

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?

EgonOlsen

Quote...with no success...
That's a bit vague...what exactly does "no success" mean in this case?

chupakabra

If I call
     Display.create();
my application stops responding(freezes).

EgonOlsen

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.

chupakabra

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.

EgonOlsen

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

chupakabra

Ok, I'll try to get some answers on their forums.

Thank you for your time.