Menu bars

I changed to jME3 now since I'm basically only trying things anyway.



With jME2, it was already not exactly straightforward to create a menu bar (like "File", "View" etc. you have in regular windows). Nothing has changed with jME3, but now I am struggling to create anything like that at all.



Now there are two ways I can think of spontaniously:

  1. Use an in-game gui to render a menu bar at the top
  2. Use the window's menu bar and render the jME canvas into the main part of that window



    Using Nifty-GUI seems very, very unintuitive at the moment, because I cannot find a reference of elements I can use. Does there exist something like this?



    For the second option there seems to be a test called TestCanvas2, but it doesn't run. That's the output I'm getting:


Jun 9, 2010 3:52:45 PM com.jme3.asset.DesktopAssetManager <init>
INFO: DesktopAssetManager created.
Jun 9, 2010 3:52:45 PM com.jme3.system.JmeSystem initialize
INFO: Running on jMonkey Engine 3 ALPHA 0.50
Exception in thread "LWJGL Renderer Thread" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
   at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
   at java.lang.Runtime.loadLibrary0(Runtime.java:823)
   at java.lang.System.loadLibrary(System.java:1028)
   at org.lwjgl.Sys$1.run(Sys.java:72)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.Sys.doLoadLibrary(Sys.java:65)
   at org.lwjgl.Sys.loadLibrary(Sys.java:81)
   at org.lwjgl.Sys.<clinit>(Sys.java:98)
   at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:146)
   at java.lang.Thread.run(Thread.java:619)



Is there something I am missing? Shouldn't there be some kind of easy support for this? I admit, it's usually not really necessary in games, but in other 3d-applications like model viewers, editors etc. I believe it is.

Any advice?

Thank you in advance,
Artjom

Seems like your lwjgl natives are missing there, are there any errors before about natives extraction? About the menu thing, its possible to do that in Nifty, for more tutorials and info please be patient, we are working on it. Meanwhile you can look at the nifty homepage and wiki for more info on how to use it. http://nifty-gui.lessvoid.com

Cheers,

Normen

I'm not sure what you mean by "natives extraction". The console output I posted is the complete output I get when I run the test.



I use jME3 from SVN. Checked it out with eclipse and didn't change anything but the exporting of libraries (to proberly link other projects with jme3).

Do you include the lwjgl-natives-2.4.jar?

Not exactly. There is a library located at jme3/lib/jwjgl/2.3_jar included in the build path. I tried changing it to 2.4 (which is present in the project but not included by default), but it yields exactly the same error.

No, its at lib/lwjgl/jME3-lwjgl-natives-2.4.jar You will need the jars from the 2.4 folder as well but this jar is where the natives are and its needed to extract them.

I'm not sure whether I got it right.



I now added the jars from the 2.4 folder as well, extracted the natives and added them as native library paths for the jwjgl.jar libraries, respectively. Is there more to be done?



Now I can start TestCanvas2, but it behaves strangely. A window appears, disappears again, appears after 5 seconds or so and then it has some kind of flickering, being focused and unfocus all the time and the mouse always reset to the window's center over and over again.

That's not how it's supposed to work, is it?

You dont need to extract the libraries, jme3 does it for you when the jME3-lwjgl-natives-2.4.jar is in the classpath.

Sorry to keep bothering you, but if I don't extract anything, but just add the jwjgl jars to the build path, the error stands as quoted above.

not!an!exit said:

Sorry to keep bothering you, but if I don't extract anything, but just add the jwjgl jars to the build path, the error stands as quoted above.

Well then use the natives directly like you did, probably some eclipse-strangeness.

Okay, thank you so far. I really appreciate it.



I got a menu bar running using the TestCanvas2 test case. For that I added a JMenuBar that is created in the test case and modified the TestBox application to use dragging to turn the camera (so that the mouse will appear to use the menu bar).



Unfortunately, there are problems with the TestCanvas2 test case, that are present disregarding whether the menu bar is there or not.



I'm using Ubuntu 9.04 (Jaunty) and Java 1.6.0_20. Whan I run the test case, the JFrame that shows up keeps being selected and deselected, flickering while it happens. If the mouse is hidden (like in the original unmodified version), it keeps appearing in the center of the frame, can be moved around for a short duration and is then reset to the center.



In order to check possible operation system incompabilities I set up the same thing using Windows XP and Java, I guess Update 16. It runs much smoother there but not without errors. The camera can be moved forward (W) and right (D), but not backward or left (S and A, respectively).



Can someone verify something of this or give useful information on how to attempt to fix it?