LWJGL Applet 2.4.2

Started by bobjob, June 13, 2010, 03:09:08

Previous topic - Next topic

bobjob

Just downloaded lwjgl_applet-2.4.2.zip and tried to run the appletLoader.html

I expected to see the gears demo, but java didnt even load (see attached image).

Also cant seem to find a good place to start with applets, i was wondering if there is any clean introduction.

I was considering using LWJGL like in a webstart and attempting to load the natives in my own way, is it more work than it is worth?
I was wondering if this is a better option to avoid the mixed code popup.

kappa

1) Which OS, Browser, Java Version do you have?

2) Do other Java Applets work?

I have been considering writing a tutorial hopefully will get to that some within the next week. However if you have a look at a few of my previous posts you should find one or two detailed posts on how they work and how to use the appletloader.

not sure how loading your own natives with jws will help you avoid a mixed code popup.

bobjob

Windows 7 32bit
Java 1.6 update 20
Internet Explorer
Yes other LWJGL applets work, I opened a Teapot applet from another thread.

I couldnt find any good solution so i decided to just use the basic jar's (lwjgl, lwjgl_util) and add the canvas to an applet
seems to work fine on windows 7.
I figure ill just do my own lzma handling.

My method, if anyone is interested:
currently the natives get extracted to the OS temp directory.
and the temp dir is added to the library path. before Display is called.
this is the working applet:http://www.have2chat.net/rts
WARNING, it will leave a copy of the relavent openAL.dll lwjgl.dll and zip holding the 2 native files lwjgl_<OS>.zip in your tempory folder
EDIT: if the applet turns red it means opengl cleared the screen red.
but once the dlls are loaded they cannot be cleaned up (while java is running).

Is Handling applets in this way a bad choice? and why?
Currently this is the method I use for my webcam chat site.

Also this may be a noob question, but does anyone know the property key for the current cache directory (at runtime)?
while Im using this method I assume it would be a better place to put the native dll files.

Oh just thought of another question, Even though unlikely I was wondering if Display.destroy() and the similar OpenAL method, unload the native libraries?

Quote from: javalwjgl on June 13, 2010, 12:20:15
not sure how loading your own natives with jws will help you avoid a mixed code popup.
sorry, i ment load LWJGL with the regular jar files, like you would when using java webstart, instead of the applet specific files.


bobjob

Think i found the problem

Windows 7:
Java 1.6.0_20

I had to save the appletloader.htm
by pasting the contents in wordpad, NOT notepad, and re saving it as appletLoader.html in windows before it would work.

bobjob

Quote from: bobjob on June 13, 2010, 22:38:49
Oh just thought of another question, Even though unlikely I was wondering if Display.destroy() and the similar OpenAL method, unload the native libraries?
noticed that the AppletLoader actually unloads previous classLoaders, very clever.

kappa

Quote from: bobjob on June 26, 2010, 21:20:52
noticed that the AppletLoader actually unloads previous classLoaders, very clever.

Yup, you'll find that the AppletLoader is a pretty neat piece of code now. It handles all sorts of java/browser/plugin/lwjgl quirks now as its slowly been maturing over the years into something that just works.

You'd be hard pressed to write something with similar compatibility without tons of testing or knowledge of java's internals.