What are the minimum requirements for running jME3 on a Mac?

I’m still wrestling with running jME within a Griffon app on a Mac. The same app works on Windows. And I can run jME samples on the Mac. But I can’t get the Griffon/jME app to work on the Mac.



The app runs, but the display is blank. Not a black empty scene, but a gray empty panel, as if nothing is rendered. The application is working, though. If I hit ‘C’ the camera position is output to the console. Navigation keys move the camera. But nothing is visible.



So, I’m suspecting this has to do with native libraries on the Mac in a Griffon app, but I don’t know enough about jME internals to know what might be the problem. Andres Almiray (lead on Griffon) asked me about the existence of a .properties file for jME, but I haven’t found anything.



I did copy liblwjgl.jnilib to staging/macosx/native and staging/macosx64/native. I also copied it to staging, staging/macosx, and staging/macosx64 for good measure. So finding that shouldn’t be an issue.



I have all the jME3 jars in the staging directory. What else could be missing?



The console output does give one indication that there is a problem:



2011-01-02 12:54:37,126 [main] INFO [griffon.swing.SwingApplication] - Initializing all startup groups: [Xref, DomainConnection, Simulator]

Calling startDaemon…

Jan 2, 2011 12:54:38 PM com.jme3.system.JmeSystem initialize

INFO: Running on jMonkey Engine 3 Alpha 0.6

Jan 2, 2011 12:54:38 PM com.jme3.system.Natives extractNativeLibs

INFO: Extraction Directory #1: file:/Users/lee/projects/Xref/staging/

Jan 2, 2011 12:54:38 PM com.jme3.system.Natives extractNativeLibs

INFO: Extraction Directory #2: /Users/lee/projects/Xref/staging

Jan 2, 2011 12:54:38 PM com.jme3.system.Natives extractNativeLibs

INFO: Extraction Directory #3: /Users/lee/projects/Xref/staging

Jan 2, 2011 12:54:39 PM com.jme3.system.lwjgl.LwjglCanvas$1 addNotify

INFO: EDT: Creating OGL thread.

Jan 2, 2011 12:54:39 PM com.jme3.system.lwjgl.LwjglAbstractDisplay run

INFO: Using LWJGL 2.5

2011-01-02 12:54:40.127 java[1676:11003] invalid drawable <


2011-01-02 12:54:40.251 java[1676:11003] invalid drawable <
Jan 2, 2011 12:54:40 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: Display created.
Jan 2, 2011 12:54:40 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: Adapter: null
Jan 2, 2011 12:54:40 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: Driver Version: null
Jan 2, 2011 12:54:40 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: Vendor: NVIDIA Corporation
Jan 2, 2011 12:54:40 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: OpenGL Version: 2.1 NVIDIA-1.6.24
Jan 2, 2011 12:54:40 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: Renderer: NVIDIA GeForce GT 330M OpenGL Engine
Jan 2, 2011 12:54:40 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread
INFO: GLSL Ver: 1.20
Jan 2, 2011 12:54:40 PM com.jme3.system.lwjgl.LwjglTimer
INFO: Timer resolution: 1000 ticks per second
Jan 2, 2011 12:54:40 PM com.jme3.renderer.lwjgl.LwjglRenderer initialize
INFO: Caps: [FrameBuffer, FrameBufferMRT, FrameBufferMultisample, OpenGL20, OpenGL21, ARBprogram, GLSL100, GLSL110, GLSL120, VertexTextureFetch, TextureArray, FloatTexture, FloatColorBuffer, FloatDepthBuffer, PackedFloatTexture, SharedExponentTexture, PackedFloatColorBuffer]
Jan 2, 2011 12:54:40 PM com.jme3.asset.DesktopAssetManager
INFO: DesktopAssetManager created.
Jan 2, 2011 12:54:40 PM com.jme3.renderer.Camera
INFO: Camera created (W: 640, H: 480)
Jan 2, 2011 12:54:40 PM com.jme3.renderer.Camera
INFO: Camera created (W: 640, H: 480)
Jan 2, 2011 12:54:40 PM com.jme3.input.lwjgl.LwjglMouseInput initialize
INFO: Mouse created.
Jan 2, 2011 12:54:40 PM com.jme3.input.lwjgl.LwjglKeyInput initialize
INFO: Keyboard created.


I don't know what "invalid drawable" means or how to fix it, but that seems to be the bit of console output that is different between the Griffon app that fails and the sample apps that run.

Thanks in advance for getting me past this painful hurdle!

Do the normal jME3 tests work? Is this application running inside a canvas?

Yes, it is running inside a canvas. Here is a snippet of Groovy:



viewer.createCanvas(); // create canvas!

JmeCanvasContext ctx = (JmeCanvasContext) viewer.getContext();

ctx.setSystemListener(viewer);

Dimension dim = new Dimension(WIDTH, HEIGHT);

ctx.getCanvas().setPreferredSize(dim);



I decided to try building a Griffon version of HelloJME3.java. I’m sorry to say that it works.



Now I’m really lost. So, it must be something in my code that is causing the display to fail. What does the error message “java[1676:11003] invalid drawable” indicate? Is there some significance to the fact that it is emitted twice?



Thanks!

That message might be coming out from Griffon, because the first log message has the same format as that error:



2011-01-02 12:54:37,126 [main] INFO [griffon.swing.SwingApplication] – Initializing all startup groups: [Xref, DomainConnection, Simulator]
...
2011-01-02 12:54:40.127 java[1676:11003] invalid drawable
2011-01-02 12:54:40.251 java[1676:11003] invalid drawable

As it turns out, this error seems to be a known issue with OpenGL on the Mac. If I’m reading things right, I think what I have to do is change the order of things, so that I don’t try to initialize jME until the Swing window is initialized, or something along those lines. I’m not sure why the Mac is more sensitive to this than Windows.

That’s somewhat strange, since jME3 canvas is initialized at the Canvas.addNotify() method, which is called after the native peer has been created.