Testing Java capabilities !! JNI & C++ with Glut !!

Hello!

I want to try to compine Java Applet and C++ Glut code.

I need to know is it possible at all, to build an Java applet to launch an JNI C++ OpenGL Glut window ??
I dont want to use JAWT, i just want to build my OpenGL example entirely with C++ and OpenGL Glut.

So no OpenGL to browser Applet window all to Glut window which is launched from C++ library.
And examples theyself are entirely at C++ library too.

Java Applet --> JNI --> C++ Example1 --> Exit back to Java Applet.
–> C++ Example2 --> Exit back to Java Applet.
–> C++ Example3 --> Exit back to Java Applet.

Im with Linux Ubuntu 9.10.

//----

Thanks,

GLUT is old and just not very good. There are already several other Java bindings for using OpenGL in an applet, so do you mind if I ask why you specifically want to use it?

Glut!

Im with my Ubuntu and i simply dont know any other OpenGL libraryes to Linux C++ than Glut and SDL, SDL it is too heavy to my use.

And as i dont want to use Applets surface to OpenGL, i have on my mind to build my entire game to C++ library and just launch it from Applet ??
Im not an professional game developer, this is just an hobby, is my way to approach OpenGL game programming too odd ??

This way i thinked i should go, as i am using C++ for game itself and Java for browser launch ??

//----

Thanks,

There is JOGL, LWGL, Slick, JSDL and others already for using OpenGL in an applet.

But anywho, yes it’s perfectly thesable and it’s essentially what JOGL does. There are multiple .dll and .so files for each OS and these are stored in various .jars. The .jars are linked to from a .jnlp file. The JNLP file is run by either the applet (via the JNLPAppletLauncher) or more recently the applet launcher in the applet tag itself (in practice you need to support both). So on startup it downloads the appropriate .jar for your system.

Your .jars will also need to be signed which the user will need to accept (most people do, but some like me don’t). Otherwise your code is fully sandboxed and won’t be allowed to use JNI. This is also why I’d recommend using something like JOGL because it’s signed by Sun Microsystems (it’s already trusted).