SimpleJMEApplet update suggestions

I'd just like to say that I'm really excited LWJGL and jME now have applet support. It's definetly fun to play around with a jME game inside of a web page!!



I just wanted to give some suggestions on small code tweaks I needed to do to the SimpleJMEApplet, that would probably be useful to other people using it.



First I wanted to be able to be able to create a glCanvas that was the size of the applet (originally it's restricted to a hard coded 640x480), I'm not sure if this restriction is a size limitation optimization for an applet, but I wanted to be able to create a higher-resolution glCanvas, here's the simple code change in the init() method:



I was thinking about it and maybe a more logical way to specify that you want to use the Applet's real size, is to just have a simple parameter specified true or false (false by default if you want to maintain to 640x480 behavior).



Applet HTML:


<applet width="1024" height="768">

640x480 was originally to fix an issue with older cards and limited possible display modes.  I'm not sure if it's an issue anymore with changes that have been made since then.  I'll look into your first suggestion.  Thanks!



The second suggestion can be handled instead by simply accessing display system via DisplaySystem.getDisplaySystem().

Another weird thing I noticed, I'm not sure if I'm doing something wrong or accidently broke something but, I seem to be getting an error before the SimpleJMEApplet is even able to do the prepForApplet():



java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path

at java.lang.ClassLoader.loadLibrary(Unknown Source)

at java.lang.Runtime.loadLibrary0(Unknown Source)

at java.lang.System.loadLibrary(Unknown Source)

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.jme.util.lwjgl.LWJGLTimer.<clinit>(Unknown Source)

at com.jme.system.lwjgl.LWJGLSystemProvider.<clinit>(Unknown Source)

at com.jme.system.DisplaySystem.getDisplaySystem(Unknown Source)

at com.jmex.awt.applet.SimpleJMEApplet.init(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

basic: Exception: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path



It seems to be happening in the SimpleJmeApplet.init() in the DisplaySystem.getDisplaySystem() call:


DisplaySystem.getDisplaySystem().prepForApplet();



I've been able to work around it by putting prepForApplet code in my SimpleJMEApplet extended class:


public class TankApplet extends SimpleJMEApplet{
 

Hmm, good point, that will make having the call generic across rendering systems interesting.  The odd thing is this has been tested on machines that have never run lwjgl apps before.  I wonder how it worked…

Ok, well I've moved the prep calls to the system provider and lazy inited the lwjgldisplaysystem which should keep everything in the jME space until after the libs are installed.  That should be in cvs later today along with the applet parameter for using applet dimensions.  There was also a bug in SimpleJMEApplet in regards to setting various min bits settings that I've fixed as well.

I think there is still a problem initializing and installing the LWGL libs. I fail at SimpleJMEApplet.java:126 because of the getSystemProvider DisplaySystem call:


://  thanks