Switching renderer in an applet context

Started by Tornado7, May 10, 2004, 04:36:53 PM

Previous topic - Next topic

Tornado7

Hi,

Is possible to use the fps's switching renderer option in a applet context? If it's so, in which way I can fit the dos command line:

java -Djava.library.path=..\..\lib\lwjgl-0.8\ -cp ..\..\lib\lwjgl-0.8\lwjgl.jar;fps.jar -Xmx100000000 JPCTDemo

into the "html code" that loads the applet?

Bye and thanks for any answers
:)

EgonOlsen

Short answer: I don't know. I never tried it. Even if it is possible somehow to make the applet access the LJWGL-DLL, this would limit your applet to Windows and you would have to sign it.
I suggest to use Webstart instead. It's easy to work with and you can make sure that every OS gets the correct native libs.

Anonymous

Sorry for ignorance  :oops: .... But, what is Webstart

EgonOlsen

Webstart is SUN's "replacement" for applets (since Java 1.2.2 or so), i.e. a way to distribute and launch applications via a network. I made some small webstart demos using jPCT. They can be found here (you need at least Java 1.3 to run them):

http://www.jpct.net/forum/viewtopic.php?t=134

All you do is to write a small XML-file that tells Java webstart what to download and what to start. I can give you a sample XML if you are interested.

Tornado7

Thank you very much for your help.... I'd have two another little questions; If I decide to use only sw renderer I'll have not, in theory, any compatibility problem?

I've a problem mapping keys to event.... In fps example, using the following code:

case (KeyEvent.VK_X): { // change renderer  (x)
           if (event) {
              switchMode=35;
           }
        break;
}

you've mapped the x small key to the "event" changing renderer; I've use a similar code to use the q small key to rotate the camera in my applet, but, running the applet, it only works if use the capital q (Q) and I don't understand why......

Bye and thanks again

EgonOlsen

No, hardware and software renderer can both do the same things. Software is just slower and doesn't look as good as hardware. But it will run everywhere, where Java1.1 is installed (including IE or NS4.7).
If you are using applets, maybe the old applet example is of interest for you. I've removed it from the distribution because it was outdated and ugly, but it's still available in this package (it's called bounce): http://www.jpct.net/download/jpctapi_096.zip
It should include some keyboard related stuff for applets. Please use just the example from this package, not the whole api.


Bart

I have searched information about using native code in applets some time ago but i didn't find much information about it. The FAQ of the LWJGL site tells that it isn't possible to use LWJGL from an applet.

QuoteQ: Is it possible to use LWJGL from an Applet?
A: Unfortunately, no. However you can start a LWJGL application from a webpage using Java WebStart. For more information click here
o java or not to java

EgonOlsen

Well, it's of course impossible to render directly into the applet, but i thought that it may be possible to open the LWJGL-window from within the applet. Anyway, a system that could probably do that can do webstart as well... :wink: