Many thanks. I have now built it from source. I still got the Null Pointer exception with the old code snippet. I changed the code snippet as per your recent post.
Now I got a class path issue For some reason when I build with target build-engine this file jME3-jogl.jar is not copied to this folder jmonkeyengine-read-only/engine/dist/lib -- all other jar's get copied. After fixing the above, Eclipse kept on complaining about gluegen-rt.jar even though it was present in the class path. I moved it to the top of the class path and Eclipse was happy. Now I am getting this error - looks like some native library is missing. Could you please point me to it. 17 Feb, 2013 8:34:50 PM com.jme3.system.JmeDesktopSystem initialize INFO: Running on jMonkeyEngine 3.0.0 RC2 Catched ZipException: error in opening zip file, while addNativeJarLibsImpl(classFromJavaJar class jogamp.nativewindow.NWJNILibLoader, classJarURL jar:file:/home/krishnak/jmonkeysource/jmonkeyengine-read-only/engine/dist/lib/jogl-all.jar!/jogamp/nativewindow/NWJNILibLoader.class, nativeJarBaseName jogl-all): jogl-all-natives-linux-i586.jar + file:/home/krishnak/jmonkeysource/jmonkeyengine-read-only/engine/dist/lib/ -> jar:file:/home/krishnak/jmonkeysource/jmonkeyengine-read-only/engine/dist/lib/jogl-all-natives-linux-i586.jar!/ Catched IOException: TempJarCache: addNativeLibs: jar:file:/home/krishnak/jmonkeysource/jmonkeyengine-read-only/engine/dist/lib/jogl-all-natives-linux-i586.jar!/, previous load attempt failed, while addNativeJarLibsImpl(classFromJavaJar class jogamp.nativewindow.NWJNILibLoader, classJarURL jar:file:/home/krishnak/jmonkeysource/jmonkeyengine-read-only/engine/dist/lib/jogl-all.jar!/jogamp/nativewindow/NWJNILibLoader.class, nativeJarBaseName jogl-all): jogl-all-natives-linux-i586.jar + file:/home/krishnak/jmonkeysource/jmonkeyengine-read-only/engine/dist/lib/ -> jar:file:/home/krishnak/jmonkeysource/jmonkeyengine-read-only/engine/dist/lib/jogl-all-natives-linux-i586.jar!/ Exception in thread "main" java.lang.UnsatisfiedLinkError: no nativewindow_awt in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681) at java.lang.Runtime.loadLibrary0(Runtime.java:840) at java.lang.System.loadLibrary(System.java:1047) at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:442) at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:59) at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:90) at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:328) at jogamp.nativewindow.NWJNILibLoader.access$000(NWJNILibLoader.java:39) at jogamp.nativewindow.NWJNILibLoader$1.run(NWJNILibLoader.java:51) at jogamp.nativewindow.NWJNILibLoader$1.run(NWJNILibLoader.java:42) at java.security.AccessController.doPrivileged(Native Method) at jogamp.nativewindow.NWJNILibLoader.loadNativeWindow(NWJNILibLoader.java:42) at jogamp.nativewindow.jawt.JAWTUtil.<clinit>(JAWTUtil.java:183) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at javax.media.nativewindow.NativeWindowFactory$3.run(NativeWindowFactory.java:241) at javax.media.nativewindow.NativeWindowFactory$3.run(NativeWindowFactory.java:238) at java.security.AccessController.doPrivileged(Native Method) at javax.media.nativewindow.NativeWindowFactory.initSingleton(NativeWindowFactory.java:238) at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1368) at javax.media.opengl.GLProfile.access$100(GLProfile.java:76) at javax.media.opengl.GLProfile$1.run(GLProfile.java:157) at java.security.AccessController.doPrivileged(Native Method) at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:123) at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:1857) at javax.media.opengl.GLProfile.get(GLProfile.java:801) at javax.media.opengl.GLProfile.get(GLProfile.java:830) at javax.media.opengl.GLProfile.getMaxFixedFunc(GLProfile.java:636) at com.jme3.system.jogl.JoglNewtAbstractDisplay.initGLCanvas(JoglNewtAbstractDisplay.java:78) at com.jme3.system.jogl.JoglNewtDisplay.privateInit(JoglNewtDisplay.java:145) at com.jme3.system.jogl.JoglNewtDisplay.create(JoglNewtDisplay.java:168) at com.jme3.app.Application.start(Application.java:387) at com.jme3.app.Application.start(Application.java:366) at com.jme3.app.SimpleApplication.start(SimpleApplication.java:131) at mygame.Main.start(Main.java:54) at mygame.Main.main(Main.java:23) |
I fixed the error reported in the earlier post
Even though the jogl-all-natives-windows-i586.jar being present in the classpath I was getting the error.Looks like it needs to be physically present in the dist/lib folder - again I am not sure whether this is a build file issue. I manually copied this file in to the dist/lib and changed the classpath. Now I have gone further, a GUI window appeared briefly and the application quit. I had to copy cp joal-natives-linux-i586.jar ../../dist/lib/ After this - it works!!! Thank you for your help. Now I will try to run this on a Raspberry Pi |
Administrator
|
It doesn't occur when you use Netbeans builder but in other cases, you have to manually copy these JARs into the dist/lib folder.
Julien Gouesse | Personal blog | Website
|
This post was updated on .
Do I need to do anything special to run the code developed to run in Headless mode (with out X) or will it work as it is?
|
This post was updated on .
It will work as is.
Especially on the Raspberry Pi where JOGL will initialize an dispmanx surface for you that paints direcly on top of the console using the broadcom specific API, using the same lines of code that you use to open a window on desktop and mobile. 2013-02-18 02:46 skrev krishnak [via jogamp]: Do I need to do anything special to run the code developed in Headless mode (with out X) or will it work as it is? If you reply to this email, your message will be added to the discussion below: http://forum.jogamp.org/JOGL-2-0-OpenGL-OpenGL-ES-backend-for-LibGDX-tp4027689p4028249.html To start a new topic under jogl, email ml-node+s762907n782158h61@n3.nabble.com To unsubscribe from jogamp, click here. NAML |
Administrator
|
In reply to this post by krishnak
Maybe you'll have to set the offscreen flag of GLCapabilities to true but I might be useless. I know it is necessary with Ardor3D, I modified the helper to allow to do that some weeks ago.
Julien Gouesse | Personal blog | Website
|
In reply to this post by Xerxes Rånby
When I move the JMonkey code which works on Ubuntu PC with JOGL to RaspberryPi - I get the following error. I get this error with or with out X. I have made sure the native libraries are in the class path. The JOGL demo's work on RaspberryPi
Feb 18, 2013 3:56:13 PM com.jme3.system.JmeDesktopSystem initialize INFO: Running on jMonkeyEngine 3.0.0 RC2 BCM.Display initIDs ok BCM.Screen initIDs ok BCM.Window initIDs ok BCM.Screen initNative ok 1920x1080 Exception in thread "main" java.lang.RuntimeException: java.lang.UnsupportedOperationException: GLSL and OpenGL2 is required for the JOGL renderer! at jogamp.newt.DefaultEDTUtil.invokeImpl(DefaultEDTUtil.java:205) at jogamp.newt.DefaultEDTUtil.invoke(DefaultEDTUtil.java:135) at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:204) at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:1577) at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:777) at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:781) at com.jogamp.newt.opengl.GLWindow.setVisible(GLWindow.java:394) at com.jme3.system.jogl.JoglNewtDisplay.createGLFrame(JoglNewtDisplay.java:67) at com.jme3.system.jogl.JoglNewtDisplay.privateInit(JoglNewtDisplay.java:147) at com.jme3.system.jogl.JoglNewtDisplay.create(JoglNewtDisplay.java:168) at com.jme3.app.Application.start(Application.java:387) at com.jme3.app.Application.start(Application.java:366) at com.jme3.app.SimpleApplication.start(SimpleApplication.java:131) at mygame.HelloPhysics.start(HelloPhysics.java:197) at mygame.HelloPhysics.main(HelloPhysics.java:25) Caused by: java.lang.UnsupportedOperationException: GLSL and OpenGL2 is required for the JOGL renderer! at com.jme3.renderer.jogl.JoglRenderer.initialize(JoglRenderer.java:168) at com.jme3.system.jogl.JoglNewtDisplay.init(JoglNewtDisplay.java:162) at jogamp.opengl.GLDrawableHelper.init(GLDrawableHelper.java:507) at jogamp.opengl.GLDrawableHelper.init(GLDrawableHelper.java:527) at jogamp.opengl.GLAutoDrawableBase$1.run(GLAutoDrawableBase.java:268) at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:902) at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:822) at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:543) at jogamp.opengl.GLAutoDrawableBase.defaultWindowResizedOp(GLAutoDrawableBase.java:129) at com.jogamp.newt.opengl.GLWindow.access$100(GLWindow.java:94) at com.jogamp.newt.opengl.GLWindow$1.windowResized(GLWindow.java:112) at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:2374) at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:2317) at jogamp.newt.WindowImpl.setVisibleActionImpl(WindowImpl.java:758) at jogamp.newt.WindowImpl$VisibleAction.run(WindowImpl.java:769) at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:131) at jogamp.newt.DefaultEDTUtil$EventDispatchThread.run(DefaultEDTUtil.java:313) EGLDisplayUtil.EGLDisplays: Shutdown (open: 1) EGLDisplayUtil: Open EGL Display Connections: 1 EGLDisplayUtil: Open[0]: 0x1: refCnt 1 Looking in to the JoglRenderer.java source it looks like the GL object is not returning the version number. Is it some missing library issue or something else? |
Administrator
|
The JARs containing the native libraries have to be in the same path than the Java libraries (which are in the classpath), but you don't need to put them into the classpath too.
There are 2 possible root causes : - the proper driver (for OpenGL ES 2.0) is not detected - JoglNewtAbstractDisplay doesn't use the good profile Try to force ES2 in JoglNewtAbstractDisplay.initGLCanvas(), maybe use GLProfile.getDefault() or GLProfile.GL2ES2.
Julien Gouesse | Personal blog | Website
|
This post was updated on .
I tried removing the native library jars from the classpath but left them in the same directory as the other library jars. The result was the same as before, same error.
I looked at Xerces's http://jogamp.org/git/?p=jogl-demos.git;a=blob;f=src/demos/es2/RawGL2ES2demo.java;hb=HEAD It uses a different type of init. How do I force ES2 - I am new to Jogl - could you please elobarate. Right now the code is just having this to set JOGL as the renderer public void start() { showSettings = false; AppSettings appSettings = new AppSettings(true); appSettings.setRenderer("JOGL"); appSettings.setAudioRenderer("JOAL"); setSettings(appSettings); super.start(); } Edit: The same jar file with i586 native libraries present in the library folder - works perfectly on PC running ubuntu. Hence I think it is very specific to raspberryPi |
In reply to this post by krishnak
To run JME3 on the RPi you need to have something more or less like:
java -Dnativewindow.ws.name=jogamp.newt.driver.bcm.vc.iv -jar MyGame.jar The "-Dnativewindow.ws.name=jogamp.newt.driver.bcm.vc.iv" MUST be there to work in X or X-less. I'm not a fan of Eclipse so your on your own there. =( |
I tried your tip but - it still gives the same error.
With reference to NetBeans/Eclipse I don't mind using either except that JMonkey platform on NetBeans keeps shutting down after 30 seconds on my computer. So I have no choice but to use eclipse for development. I don't think there is a relation between the IDE and the produced JAR resulting in this problem. On the Raspberry Pi - I am able to get the JOGL demos working with and with out X. They use the same glugen-rt-native-linux-armv6hf.jar and jog-all-natives-linux-arm6hf.jar which is used by my jar. I have tried removing the above mentioned native jar's from the library folder to check whether I get the same error. If I remove them I get a class not found error. Once they are put back, I get this error java.lang.UnsupportedOperationException: GLSL and OpenGL2 is required for the JOGL renderer! at jogamp.newt.DefaultEDTUtil.invokeImpl(DefaultEDTUtil.java:205) |
This post was updated on .
I have now answered your question in the Raspberry Pi forum http://www.raspberrypi.org/phpBB3/viewtopic.php?p=291539#p291539 Basically, like gouessej said above, you need to initialize jME3 using an OpenGL ES 1 or OpenGL ES 2 profile depending on the JME3 application configuration. On Desktop OpenGL 2 contains both fixed functions and programmable shaders while on mobile you have to choose fixed function OR shaders. |
In reply to this post by dardzull@yahoo.com
Nope this is no longer needed to add the -Dnativewindow.ws.name=jogamp.newt.driver.bcm.vc.iv if you use JogAmp JOGL rc11 or later. We have added Raspberry Pi nativewindow autodetection in the latest releases. I have updated the http://labb.zafena.se/?p=547 introduction article to demonstrate that it is now possible to run JOGl code on the Raspberry Pi without adding any Pi specific system properties. The following lines of code will run on both desktop and on the raspberry pi!
|
So use the Feb 19 autobuilds?
|
Use the jogamp-current ( currently is the 1nov 2012 rc11 release) or if you prefer the latest auto-build. Both are supposed to work. USB Keyboard NEWT input support is better on the Raspberry Pi if you use the auto-builds. http://jogamp.org/deployment/jogamp-current/ <- the current release http://jogamp.org/deployment/archive/master/?C=M;O=D <- list of the latest build aggregates (testing) |
Administrator
|
In reply to this post by krishnak
Look at this line of code and replace GLProfile.getMaxFixedFunc(true) by GLProfile.getDefault() or GLProfile.GL2ES2. Let me know whether it works. Ok but this is the right way of using JogAmp APIs. The JARs containing native libraries contain no class, therefore they should not be in the classpath. Edit.: I'll try to fix that but please tell me whether any modification I suggested works on Raspberry Pi.
Julien Gouesse | Personal blog | Website
|
Administrator
|
In reply to this post by Xerxes Rånby
On 02/19/2013 10:10 AM, Xerxes Rånby [via jogamp] wrote:
> Dardzull wrote > So use the Feb 19 autobuilds? > > Use the jogamp-current ( currently is the 1nov 2012 rc11 release) or if you > prefer the latest auto-build. Both are supposed to work. Keyboard NEWT support > are better in the autobuilds. > To make life easier .. just pick one of the latest aggregated autobuilds to test latest developments, while using the usual and convenient 'jogamp-all-platforms.7z'. This URL shows you the latest on top: http://jogamp.org/deployment/archive/master/?C=M;O=D E.g.: http://jogamp.org/deployment/archive/master/gluegen_634-joal_401-jogl_911-jocl_745/archive/jogamp-all-platforms.7z ~Sven signature.asc (911 bytes) Download Attachment |
In reply to this post by Xerxes Rånby
I modified the single line as per this commit in my JMonkeysource
https://github.com/noxo/jmonkey-engine-jogl-gles/commit/cbb22843dd98532cee1e2727049ca9f043158195 After rebuilding everything on the PC and making sure it works, I moved it to Pi In the PI, things are moving forward but now I am getting a JOAL error - the native library is in the folder pi@raspberrypi ~/jogamp $ java -jar test2.jar Feb 19, 2013 9:52:12 AM com.jme3.system.JmeDesktopSystem initialize INFO: Running on jMonkeyEngine 3.0.0 RC2 BCM.Display initIDs ok BCM.Screen initIDs ok BCM.Window initIDs ok BCM.Screen initNative ok 720x576 Feb 19, 2013 9:52:32 AM com.jme3.renderer.jogl.JoglRenderer initialize WARNING: Failed parsing GLSL version assuming it's v1.00 Feb 19, 2013 9:52:32 AM com.jme3.renderer.jogl.JoglRenderer initialize WARNING: Your graphics card does not support non-power-of-2 textures. Some features might not work. Exception in thread "main" java.lang.RuntimeException: java.lang.ExceptionInInitializerError at jogamp.newt.DefaultEDTUtil.invokeImpl(DefaultEDTUtil.java:205) at jogamp.newt.DefaultEDTUtil.invoke(DefaultEDTUtil.java:135) at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:204) at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:1577) at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:777) at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:781) at com.jogamp.newt.opengl.GLWindow.setVisible(GLWindow.java:394) at com.jme3.system.jogl.JoglNewtDisplay.createGLFrame(JoglNewtDisplay.java:67) at com.jme3.system.jogl.JoglNewtDisplay.privateInit(JoglNewtDisplay.java:147) at com.jme3.system.jogl.JoglNewtDisplay.create(JoglNewtDisplay.java:168) at com.jme3.app.Application.start(Application.java:387) at com.jme3.app.Application.start(Application.java:366) at com.jme3.app.SimpleApplication.start(SimpleApplication.java:131) at mygame.HelloPhysics.start(HelloPhysics.java:203) at mygame.HelloPhysics.main(HelloPhysics.java:28) Caused by: java.lang.ExceptionInInitializerError at com.jogamp.openal.ALFactory.initialize(ALFactory.java:60) at com.jogamp.openal.ALFactory.getALC(ALFactory.java:94) at com.jogamp.openal.util.ALut.alutInit(ALut.java:66) at com.jme3.audio.joal.JoalAudioRenderer.<clinit>(JoalAudioRenderer.java:82) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186) at com.jme3.system.JmeDesktopSystem.newAudioRenderer(JmeDesktopSystem.java:263) at com.jme3.system.JmeSystem.newAudioRenderer(JmeSystem.java:143) at com.jme3.app.Application.initAudio(Application.java:229) at com.jme3.app.Application.initialize(Application.java:506) at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:184) at com.jme3.system.jogl.JoglNewtDisplay.init(JoglNewtDisplay.java:163) at jogamp.opengl.GLDrawableHelper.init(GLDrawableHelper.java:507) at jogamp.opengl.GLDrawableHelper.init(GLDrawableHelper.java:527) at jogamp.opengl.GLAutoDrawableBase$1.run(GLAutoDrawableBase.java:268) at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:902) at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:822) at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:543) at jogamp.opengl.GLAutoDrawableBase.defaultWindowResizedOp(GLAutoDrawableBase.java:129) at com.jogamp.newt.opengl.GLWindow.access$100(GLWindow.java:94) at com.jogamp.newt.opengl.GLWindow$1.windowResized(GLWindow.java:112) at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:2374) at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:2317) at jogamp.newt.WindowImpl.setVisibleActionImpl(WindowImpl.java:758) at jogamp.newt.WindowImpl$VisibleAction.run(WindowImpl.java:769) at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:131) at jogamp.newt.DefaultEDTUtil$EventDispatchThread.run(DefaultEDTUtil.java:313) Caused by: java.lang.RuntimeException: Couln't load native AL library at jogamp.openal.ALImpl.<clinit>(ALImpl.java:2407) ... 27 more EGLDisplayUtil.EGLDisplays: Shutdown (open: 1) EGLDisplayUtil: Open EGL Display Connections: 1 EGLDisplayUtil: Open[0]: 0x1: refCnt 1 |
This time its the JOAL OpenAL-soft sound initialization that fail, you run into this because you try use the latest JogAmp test build. We are actively working on this, currently we bundle OpenAL-soft with JOGL compiled for ARMv7, JogAmp needs to lower the cross compile C options to target ARMv6 in order to make the JogAmp JOAL builds fully RaspberryPi compatible, the RaspberryPi CPU is ARMv6. The workaround for you is to pass -Djoal.openal.lib=system JOAL will then use the OpenAL library provided by your RaspberryPi linux distribution. Its possible that you may need to install the libopenal1 package. sudo apt-get install libopenal1 For more information see BUG 662 or the following git commit: https://github.com/sgothel/joal/commit/92e931caf64cf24e2b885d2552e64aebcf70a45a |
Administrator
|
In reply to this post by krishnak
Ok I will switch to getDefault() but there is no ideal solution for JMonkeyEngine as the classes handling the abstract display know nothing about the renderer that you're going to use.
Julien Gouesse | Personal blog | Website
|
Free forum by Nabble | Edit this page |