Are LWJGL applets supposed to work on Snow Leopard using Firefox?

I wanted to give LWJGL a try, skipping directly to applets (webstart is not an option anymore for now…)

I’m using the basic Gears demo as a test ( http://lwjgl.org/applet/ )

So far, it works fine on 3 different Windows machines (using FF and Explorer…)

Unfortunately, it’s another story on my MacBook Pro (Snow Leopard 10.6.4; Java 1.6.0_20; NVIDIA GeForce GT 330M):

  • It does work, using Safari 5.0

  • It does not work, using FF 3.6.8, with the following log:

MRJ Plugin for Mac OS X v1.0.1
[starting up Java Applet Security @ Sun Aug 01 16:52:13 IDT 2010]
Sun Aug 01 16:52:14 IDT 2010 JEP creating applet org.lwjgl.util.applet.AppletLoader (http://lwjgl.org/applet/)
org.lwjgl.LWJGLException: Could not create pixel format
at org.lwjgl.opengl.MacOSXPeerInfo.nChoosePixelFormat(Native Method)
at org.lwjgl.opengl.MacOSXPeerInfo.choosePixelFormat(MacOSXPeerInfo.java:55)
at org.lwjgl.opengl.MacOSXPeerInfo.(MacOSXPeerInfo.java:50)
at org.lwjgl.opengl.MacOSXCanvasPeerInfo.(MacOSXCanvasPeerInfo.java:49)
at org.lwjgl.opengl.MacOSXDisplayPeerInfo.(MacOSXDisplayPeerInfo.java:48)
at org.lwjgl.opengl.MacOSXDisplay.createPeerInfo(MacOSXDisplay.java:246)
at org.lwjgl.opengl.Display.create(Display.java:853)
at org.lwjgl.opengl.Display.create(Display.java:783)
at org.lwjgl.opengl.Display.create(Display.java:764)
at org.lwjgl.test.applet.GearsApplet$1.run(GearsApplet.java:54)
Exception in thread “Thread-9” java.lang.NullPointerException
at org.lwjgl.opengl.GL11.glClear(GL11.java:585)
at org.lwjgl.test.applet.GearsApplet.drawLoop(GearsApplet.java:196)
at org.lwjgl.test.applet.GearsApplet.gameLoop(GearsApplet.java:136)
at org.lwjgl.test.applet.GearsApplet$1.run(GearsApplet.java:59)

I’m using the “defaults settings” in Java Preferences, since I’m looking for a solution that works “out-of-the-box” for the average user.

Any clues?
Thanks!

Ariel
http://chronotext.org

Well, at least it seems to be a problem common to Jogl, namely: the change in “Plugin2 Graphics Rendering” introduced lately by Apple

However, I still don’t get why LWJGL and JOGL are working in Safari but not in FF.

I also don’t get why the following is not making any difference on my MacBook pro: going to the Java Prefs and toggling between “Run applets in their own process” and “Run applet within the Browser process”, followed by a browser (or even a machine) restart…

Bah, nothing new (Java + OpenGL in the Browser == Quest for the Holy Grail)

FF uses the old plugin1 code, Safari uses plugin2. You can make Safari work by telling it not to run the JVM in a separate process but I’m a bit hazy on the details, which are documented somewhere around these parts.

Cas :slight_smile:

Thanks Cas, even though I’m even more confused than before! The thing is that everything works fine, actually in Safari.

The problem is in Firefox: LWJGL and JOGL seem to suffer from the same “can’t create pixel format” problem.

And now you say that Safari uses plugin2 while Firefox uses plugin1.
It means that my problem is actually not related to “Apple’s recent change in plugin2 architecture”.

Doh…
Anyone else affected?

Does Minecraft work?

Cas :slight_smile:

The thread containing the information about apple breaking JOGL/LWJGL Applets can be found here.

arielm: From your description it does not sound like its related to the above problem, since that only effects plugin2 and not plugin1.

Sadly Mac is the weakest platform when it comes to LWJGL Applets, where as Windows and Linux have very good compatibility which is IMO equivalent to running a standalone Native LWJGL Display now.

The problems with LWJGL Applets on mac are is mostly due to the following:

  1. LWJGL Dev’s mostly lack macs so LWJGL Applets are less well tested.
  2. Apples Stupid Policy of not sharing their own java plugin implementation, resulting in browsers like FF having to rely on a crappy 3rd party implementation which is very buggy.
  3. Apple recent move with plugin2 highlighted in the above linked thread.
  4. Chrome using plugin2 exclusively and being unable to work with plugin1 (forcing the above issue in the linked thread).

Now I’m not sure why its failing for you on firefox, but could you try see if Final Kapster works for you. If so I might have a solution for you.

[IN RESPONSE TO CAS - RESPONSE TO KAPTA COMING SOON…]

Strange!

Minecraft worked in Firefox.
And then, the official LWJGL Gears applet started to work as well…

But then, I made a restart and now, none of them are working (the same old “org.lwjgl.LWJGLException: Could not create pixel format”…)

Actually, this kind of voodoo already happened to me yesterday: suddenly, every LWJGL or Jogl applet is working. But then, after a restart: poof, nothing is working again.

My theory?
From time to time, I go to the Java Prefs and I toggle between “Run applets in their own process” and “Run applet within the Browser process”.
Then, I restart the browser, but usually: nothing is changing.
But then, eventually, after a restart or two, my “toggle operation in the prefs” is somehow having some positive effect (however, the positive effect in question is only temporary, until the next restart…)

It could be related to the “created and removed symlinks” mentioned in that same old Apple note.

Sounds bad, especially from the end-user standpoint (I guess I’m not the only MacBook pro owner affected…)

yes this is the workaround highlighted in the thread linked above and fix for mac issue 3) that i pointed out.
Using “Run Applet in their own process” will make browsers use plugin2 (and hence the new renderer that breaks JOGL/LWJGL applets) and setting it off will switch to plugin1.

I don’t know…
Toggling between these 2 options in the Java prefs never had any immediate effect (only some voodoo echo after n restarts…)

No, it’s not working here in Firefox (same pixel format exception…)

Yeah, my “problem” seems to be exactly the contrary of all the mentioned discussions, since everything always works fine in Safari, but almost never in Firefox.

Working randomly one time or another : sounds like a race condition to me.

Cas :slight_smile: