OpenAL: Split platform dependent code from extal.c into platform subdirs. Made nCreate take a path instead of an array of paths.

This commit is contained in:
Elias Naur 2006-01-16 15:54:50 +00:00
parent c7f671d062
commit c26ebafa62
7 changed files with 272 additions and 258 deletions

View file

@ -65,7 +65,7 @@ public final class AL {
*
* @param oalPaths Array of strings containing paths to search for OpenAL library
*/
private static native void nCreate(String[] oalPaths) throws LWJGLException;
private static native void nCreate(String oalPath) throws LWJGLException;
/**
* Native method the destroy the AL
@ -99,8 +99,17 @@ public final class AL {
"openal", "libopenal.so",
"openal", "openal.dylib"}, AL.class.getClassLoader());
LWJGLUtil.log("Found " + oalPaths.length + " OpenAL paths");
nCreate(oalPaths);
created = true;
for (int i = 0; i < oalPaths.length; i++) {
try {
nCreate(oalPaths[i]);
created = true;
break;
} catch (LWJGLException e) {
LWJGLUtil.log("Failed to load " + oalPaths[i] + ": " + e.getMessage());
}
}
if (!created)
throw new LWJGLException("Could not locate OpenAL library.");
try {
AL10.initNativeStubs();