LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: EgonOlsen on April 25, 2005, 19:05:40

Title: LWJGL in an Applet
Post by: EgonOlsen on April 25, 2005, 19:05:40
Maybe not very important nowadays, but with the new AWTGLCanvas, it's possible to use LWJGL in an Applet (some pitfalls when loading the native parts remain...anyway):

An example (using jPCT): http://www.jpct.net/img/lwjgl_applet.jpg

So it works, but its speed is 1/10th of the "normal" speed. I expected it to be slower...but that slow? Any ideas what may cause this?
Title: LWJGL in an Applet
Post by: Matzon on April 29, 2005, 10:59:14
Are you making a lot of reapint requests ?
at one point in time my animator thread made all the repaint events it couldm without yielding or sleeping - the result was a much slower speed than with pauses.

Usually I get 2/3 speed in a simple test.

How did you get applets going?
Does it render as slow in an application instead of in a browser ?
Title: LWJGL in an Applet
Post by: EgonOlsen on April 29, 2005, 11:32:03
Quote from: "Matzon"
Does it render as slow in an application instead of in a browser ?
No, it's great in an application (about 10 times as fast as the applet). It's even a bit faster than using the "normal" LWJGL window sometimes (on HT and dual cpu machines), because calculations and rendering happen in different threads now.
Anyway, in an applet, it's real slow using exactly the same repaint behaviour like in the application. Anyway, it doesn't really matter to me, i'm just interested in why this could be the case and if there is something i can do about it (i guess not).
Title: LWJGL in an Applet
Post by: princec on April 29, 2005, 16:47:41
In an applet we're at the mercy of AWT's integration with the OS. It's as fast as AWT lets us get without getting hairy.

Cas :)