how are native libs for different platforms handled in a webstart game?

Started by lobsterman, June 23, 2008, 14:15:53

Previous topic - Next topic

lobsterman

i have gotten quite a bit beyond where i was a few weeks back. however there is the issue of the native libs that i am seriously struggling with.

i know how to have the native libs for my mac accessible when i run it on my mac - i either place them into Library/Java/Extensions or i add a path to them via -Djava. but how are native libs handled when a user runs the webstart app of the game on their machine, which may be something other than a mac.

any insight would be greatly appreciated,

Matzon

<resources os="Linux" arch="i386">
  <j2se version="1.4+"/>
  <nativelib href="lwjgl_linux.jar"/>
</resources>

for instance

lobsterman

thanks,

so the resources block goes into the jnlp file - i assume. the lwjgl download comes with native libs but they are not jars. for instance the linux native libs are 5 *.so files. how do i get my grubby hands on the jars?

- do i make my own jar out of these files and sign them?
- are they available for download somewhere on the lwjgl server?
- or do i just use the native libs the way they are?

would this work?
  <resources>
    <j2se version="1.4+"/>
    <jar href="Game_signed.jar"/>
  </resources>
  <resources os="Mac OS X">
    <nativelib href="libjinput-osx.jnilib"/>
    <nativelib href="liblwjgl.jnilib"/>
    <nativelib href="openal.dylib"/>
  </resources>


thanks,

Matzon

depends on whether you want to sign your own files or rely on the lwjgl certificate - notice the extension tag. It usesd the latest version 2.0rc1

<!-- JNLP File for LWJGL Demos --> 
<jnlp 
  spec="1.0+" 
  codebase="http://lwjgl.org/jnlp/" 
  href="lwjgl-demo.php/examples.spaceinvaders.Game"> 
  <information> 
    <title>LWJGL Demo [examples.spaceinvaders.Game]</title> 
    <vendor>LWJGL</vendor> 
    <homepage href="http://lwjgl.org/"/> 
    <description>Demonstration of LWJGL</description> 
    <description kind="short">Technology Preview</description> 
    <icon kind="splash" href="logo.png" />
    <offline-allowed/> 
  </information> 
  <resources> 
    <j2se version="1.4+"/> 
		<jar href="lwjgl_test.jar"/>
    <jar href="media.jar"/>
    <extension name="lwjgl" href="http://lwjgl.org/jnlp/extension.php" />
  </resources> 
  <application-desc main-class="org.lwjgl.examples.spaceinvaders.Game">
    </application-desc>
</jnlp>

lobsterman

major thanks,

so the tag

    <extension name="lwjgl" href="http://lwjgl.org/jnlp/extension.php" />


does all the magic. works like a gem in my jnlp file.

pretty wild, thanks again ...

Jerome Blouin

Can I specify a version/release to the extension? I'd like to target a stable release. If yes, is there a list of versions?

Thanks

Matzon

there is only the latest release so to speak - I keep wanting to do something to support old releases - but haven't done so far ...

Jerome Blouin

Does this mean that the latest release could be a non-final release like beta, RC?

Matzon

yes, but it would be relatively stable. That said, until I have some versioning in order, I do not recommend using it for commercial deployment (where I would also advise to sign it yourself)