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/ (http://l33tlabs.org/) and nifty-gui http://nifty-gui.lessvoid.com/ (http://nifty-gui.lessvoid.com/), but with no success.
Is there an tutorial or example source code?
Quote...with no success...
That's a bit vague...what exactly does "no success" mean in this case?
If I call
Display.create();
my application stops responding(freezes).
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 (http://www.jpct.net/doc/com/threed/jpct/Config.html#glSkipInitialization), but you have to do the setup all by yourself then.
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.
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.
Ok, I'll try to get some answers on their forums.
Thank you for your time.