www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: chupakabra on June 21, 2013, 09:16:39 am

Title: GUI over JPCT
Post by: chupakabra 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/  (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?
Title: Re: GUI over JPCT
Post by: EgonOlsen 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?
Title: Re: GUI over JPCT
Post by: chupakabra on June 21, 2013, 11:26:36 am
If I call
     Display.create();
my application stops responding(freezes).
Title: Re: GUI over JPCT
Post by: EgonOlsen 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 (http://www.jpct.net/doc/com/threed/jpct/Config.html#glSkipInitialization), but you have to do the setup all by yourself then.
Title: Re: GUI over JPCT
Post by: chupakabra 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.
Title: Re: GUI over JPCT
Post by: EgonOlsen 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.
Title: Re: GUI over JPCT
Post by: chupakabra on June 24, 2013, 01:35:41 pm
Ok, I'll try to get some answers on their forums.

Thank you for your time.