Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (494)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Java Sound & OpenAL / Re: JOAL with JNLPAppletLauncher on: 2008-06-09 12:18:28
OK i found a workaround for those interested in this issue. I have added the following code in the "extractNativeLibs" method from the JNLPAppletLauncher, juste before the "nativeLibMap.put(libName, nativeLib.getAbsolutePath());" line (code is borrowed from the JOGLAppletLauncher) :

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
                if(entryName.toLowerCase().equals("openal32.dll"))
                {
                    // Append the installed native library directory to
                   // java.library.path. This is the most convenient way to
                   // make this directory available to the NativeLibrary code,
                   // which needs it for loading OpenAL if present.
                   String javaLibPath = System.getProperty("java.library.path");
                    String absPath = nativeTmpDir.getAbsolutePath();
                    boolean shouldSet = false;
                    if (javaLibPath == null) {
                      javaLibPath = absPath;
                      shouldSet = true;
                    } else if (javaLibPath.indexOf(absPath) < 0) {
                      javaLibPath = javaLibPath + File.pathSeparator + absPath;
                      shouldSet = true;
                    }
                    if (shouldSet) {
                      System.setProperty("java.library.path", javaLibPath);
                    }
                    System.out.println(System.getProperty("java.library.path"));
                }
2  Java Game APIs & Engines / Java Sound & OpenAL / Re: JOAL with JNLPAppletLauncher on: 2008-06-09 09:12:30
(I changed my account name as I realised it was available again)

I think the loading of OpenAL32.dll and wrap_oal.dll works on the JOGLAppletLauncher thanks to this code :

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
          if (haveJOAL) {
            // Turn off the System.loadLibrary call of the joal_native
           // library. It will still need to load the OpenAL library
           // internally via another mechanism.
           try {
              Class c = Class.forName("net.java.games.joal.impl.NativeLibLoader");
              c.getMethod("disableLoading", new Class[] {}).invoke(null, new Object[] {});
            } catch (Exception e) {
              e.printStackTrace();
            }

            // Append the installed native library directory to
           // java.library.path. This is the most convenient way to
           // make this directory available to the NativeLibrary code,
           // which needs it for loading OpenAL if present.
           String javaLibPath = System.getProperty("java.library.path");
            String absPath = nativeLibDir.getAbsolutePath();
            boolean shouldSet = false;
            if (javaLibPath == null) {
              javaLibPath = absPath;
              shouldSet = true;
            } else if (javaLibPath.indexOf(absPath) < 0) {
              javaLibPath = javaLibPath + File.pathSeparator + absPath;
              shouldSet = true;
            }
            if (shouldSet) {
              System.setProperty("java.library.path", javaLibPath);
            }

            // Load core JOAL native library
           loadLibrary(nativeLibDir, "joal_native");
          }


But the JNLPAppletLauncher does not extract the content of the joal-native-xxx.jar, so even if I add this code at the beginning of my app it will not work. Does anybody have an idea ?
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Dwinin (19 views)
2014-09-12 09:08:26

Norakomi (54 views)
2014-09-10 13:57:51

TehJavaDev (63 views)
2014-09-10 06:39:09

Tekkerue (31 views)
2014-09-09 02:24:56

mitcheeb (53 views)
2014-09-08 06:06:29

BurntPizza (37 views)
2014-09-07 01:13:42

Longarmx (23 views)
2014-09-07 01:12:14

Longarmx (27 views)
2014-09-07 01:11:22

Longarmx (27 views)
2014-09-07 01:10:19

mitcheeb (35 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!