Mac OS X: Load the framework (builtin) version of OpenAL last, after having tried all possible locations of a private openal.dylib

This commit is contained in:
Elias Naur 2006-01-16 19:35:09 +00:00
parent a47ec6d86f
commit 19d2d219ec
3 changed files with 23 additions and 6 deletions

View file

@ -66,6 +66,14 @@ public final class AL {
* @param oalPaths Array of strings containing paths to search for OpenAL library
*/
private static native void nCreate(String oalPath) throws LWJGLException;
/**
* Native method to create AL instance from the Mac OS X 10.4 OpenAL framework.
* It is only defined in the Mac OS X native library.
*
* @param oalPaths Array of strings containing paths to search for OpenAL library
*/
private static native void nCreateDefault() throws LWJGLException;
/**
* Native method the destroy the AL
@ -108,6 +116,11 @@ public final class AL {
LWJGLUtil.log("Failed to load " + oalPaths[i] + ": " + e.getMessage());
}
}
if (!created && LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) {
// Try to load OpenAL from the framework instead
nCreateDefault();
created = true;
}
if (!created)
throw new LWJGLException("Could not locate OpenAL library.");