Second, check the version of your JVM on XP. If it's not up to date then try updating, it might be a JVM version specific bug.

Third, I was under the presumption that Java will automatically use OpenGL or Direct3D for you. That you only need to set flags on older versions where it's off by default, and so in practice it should be left up to the JVM. It will also only ever use Direct3D on newer JVMs (I believe it's from Java 6 update 10 onwards) on Windows, so disabling OpenGL will probably just cause bad performance for people using an older JVM.

Finally, the JVM doesn't use OpenGL/Direct3D for everything. If you want real performance gains then you'd be best using the Java OpenGL bindings directly. There are also plenty of libraries that offer their own simpler Graphics interface on top.

I haven't made any changes to my JVMs settings. It's using it's default install settings and works perfectly on both of those.

You didn't mention which version of Java your running. Have you checked this? Have you tried updating it?

I don't think you should really bother setting Dsun.java2d.opengl=true yourself. It's only present and disabled on Java 5, that's because it was in beta. On Java 6 I'm pretty certain it's on by default. I'd recommend removing this parameter from your applet tag.

Unfortunately the openGL pipeline hasn't worked on windows machines for some time. I don't think it's a priority for Sun's java2D team to fix it since the D3D pipeline works so well. You should ask Dmitri Trembovetski about it on the Java2D forums, he's very helpful.

PS: setting d3d=true is really the only option you need. You don't need it at all if the user has java6 update 10 or better since it's enabled by default for windows machines with non-intel video cards.

Good question, you should ask this in the java2d forum because then Dmitri T might answer it, he's the expert engineer from Sun who kindly helps us out.

You're correct that you need openGL on linux and friends and d3d on windows to achieve acceleration.

Picking which one is not an easy option unless you ask your user to select the right webstart link (or is there a javascript way to detect which OS the user is on?).

The problem with webstart is that the display of the download dialogs cause one of the java2d pipelines to be used (the one specified in your jnlp file, or whatever the default pipeline is), which means that you can't switch pipelines yourself programatically since the display was already initialised. If you use an installer or something intead, you can programatically select the d3d pipeline by putting this code in your main class:

1 2 3

static{System.setProperty("sun.java2d.d3d", "True");}

The capital T will mean that "Direct3D pipeline enabled on screen 0" will be printed if successful.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org