LWJGL Applet

Started by CaseyB, September 09, 2005, 21:02:07

Previous topic - Next topic

clilian

You just have to use another class to initialize the boolean (like "SysContext.setAppletExecution(true)")
and then use SysContex.isAppletExcecution() to enable Sys lib loading

It will work as long as the "SysContext" is invoked/references before the Sys class.

Lilian

Matzon

Quote from: "Kokoni"
I have tested with Firefox and IE, no changes, I'm always around 120 fps./quote] Great!
you have something we can test - and a patch file or list of changes ?

Kokoni

Matzon,

I'm going to put the applet online then people will see the result. Before that I have to clean the Lwjgl launcher class file. Some Lilian's JOGL comments are still in source code.

Concerning the Sys class, currently I have commented the static part, but I think the Lilian's solution is really better. So I will create a SysContext class with a static method which will enabled/disabled the load of the lib (in the Sys static part).

When it will be ready, I will post the link here, with the changes of Sys.class

Matzon

whats the status of this? - I would like to get this in the code base - so if you need some help?

Kokoni

Sorry for the delay, I have currently many things to do. I've not completly performed the code clean up, it will be probably done tomorrow.

For now, I can just put a link with the applet working : http://nicolas.esteban.free.fr/lwjgl/lwjgl-applet.html

too many jar are loaded, it was just for my test  :roll: The final version will be more    light.

Matzon

cool, I got it working - however not without issues:
The very first time I ran it in Firefox I got a:

QuoteInstalling native files
Download complete
Starting GeoApplet
C:\Documents and Settings\Brian Matzon\.geoapplet\nicolas_esteban_free_fr_lwjgl_\lwjgl.dll
Exception in thread "AWT-EventQueue-1" 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:67)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.Sys.<clinit>(Sys.java:65)
   at org.lwjgl.opengl.AWTGLCanvas.<clinit>(AWTGLCanvas.java:63)
   at org.geo4j.applet.test.LWJGLApplet.init(LWJGLApplet.java:43)
   at org.geo4j.applet.GeoAppletLauncher.startSubApplet(GeoAppletLauncher.java:511)
   at org.geo4j.applet.GeoAppletLauncher.access$3(GeoAppletLauncher.java:493)
   at org.geo4j.applet.GeoAppletLauncher$2.run(GeoAppletLauncher.java:487)

second time, and subsequent times worked fine, though speed was slow in both IE and Firefox:
QuoteGL_VENDOR: NVIDIA Corporation
GL_RENDERER: GeForce 6600 GT/AGP/SSE2
GL_VERSION: 2.0.1

glLoadTransposeMatrixfARB() supported: true
340 frames in 5.0 seconds = 68.0
299 frames in 5.0 seconds = 59.8

additionally I got some random exceptions:

(startup, once, first time)
QuoteException in thread "AWT-EventQueue-1" java.lang.IllegalArgumentException: null source
   at java.util.EventObject.<init>(Unknown Source)
   at java.awt.AWTEvent.<init>(Unknown Source)
   at java.awt.event.ComponentEvent.<init>(Unknown Source)
   at java.awt.event.WindowEvent.<init>(Unknown Source)
   at java.awt.event.WindowEvent.<init>(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.SequencedEvent.dispatch(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)

(every shutdown)
QuoteThread[AWT-EventQueue-2,4,http://nicolas.esteban.free.fr/lwjgl/-threadGroup] already has the context current
   at org.lwjgl.opengl.Context.checkAccess(Context.java:169)
   at org.lwjgl.opengl.Context.forceDestroy(Context.java:226)
   at org.lwjgl.opengl.AWTGLCanvas.destroyContext(AWTGLCanvas.java:220)
   at org.lwjgl.opengl.AWTGLCanvas.removeNotify(AWTGLCanvas.java:166)
   at java.awt.Container.removeNotify(Unknown Source)
   at java.awt.Container.removeNotify(Unknown Source)
   at java.awt.Container.remove(Unknown Source)
   at java.awt.Container.remove(Unknown Source)
   at sun.applet.AppletPanel.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

additionally Firefox didn't quit like expected - it shutdown, but the process hung in the background - probably related to the exception on shutdown

Matzon

btw: Doesn't work with opera at all - but neither does the jogl launcher.

Matzon

got it running full speed in IE *AND* Firefox - thou still no where near native display :(
apparently vsync was on - disabled in drivers and good to go.

Kokoni

First of all, thanks for the feedback.

the "geoapplet" which is my own project will become "lwjglapplet" for generic reasons. For the issue, I will try to reproduce it, but for now I have to go to my office  :lol:

clilian

Hi, I just wanted to add that according to my own tests (well, with a test case provided by Ken Russel from JOGL), LWJGL is facing the same problem than JOGL : slow frame rate for applets on firefox (around 100 fps) instead of > 2000 in IE. better than the current build of JOGL, but not yet perfect...

Regards,

Lilian

Matzon

I get full speed in both. Where is that jogl test case ?

clilian

well it's just a simple applet with a rotating triangle (I've put the lwjgl jars and natives in the jre/lib/ext and jre/bin folders).

On my laptop JOGL/LWJGL run at full speed with FF, on my desktop pc both are dog slow (but LWJGL is faster).

Lilian

radvani

Hi everyone,

So, did anyone manage to get that Firefox LWJGL applet up to speed with explorer?

Also, is an LWJGLAppletLauncher available now in the CVS tree? I haven't seen it yet. I'd like to give it a shot and work on debugging some of the issues.

Raj

radvani

I just realized my previous post made no sense: it should have read, "did anyone get that LWJGL applet to run fast in firefox?"

renanse

Is there anything further on this?  When I run the example a few posts above in FireFox, fraps is maxing out at 999FPS, so it looks like things are running nicely....  Is there an official way of displaying in an applet in lwjgl yet?