diff options
Diffstat (limited to 'src/java/com/jogamp/openal/eax')
-rw-r--r-- | src/java/com/jogamp/openal/eax/EAXFactory.java | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/java/com/jogamp/openal/eax/EAXFactory.java b/src/java/com/jogamp/openal/eax/EAXFactory.java index 0e305a5..01d336c 100644 --- a/src/java/com/jogamp/openal/eax/EAXFactory.java +++ b/src/java/com/jogamp/openal/eax/EAXFactory.java @@ -39,20 +39,33 @@ import com.jogamp.openal.ALFactory; * */ public final class EAXFactory { + public static final boolean DEBUG; static { //initializes JOAL ALFactory.getAL(); + DEBUG = ALFactory.DEBUG; } - private static EAX eax; + private static EAX eax = null; + private static boolean eaxTried = false; private static native void init(); - public static EAX getEAX() { - if (eax == null) { - init(); - eax = new EAX(EAX.SOURCE, EAX.LISTENER); + public static synchronized EAX getEAX() { + try { + if (!eaxTried) { + eaxTried = true; + init(); + eax = new EAX(EAX.SOURCE, EAX.LISTENER); + if(DEBUG) { + System.err.println("EAX initialized"); + } + } + } catch (UnsatisfiedLinkError e) { + if(DEBUG) { + e.printStackTrace(); + } } return eax; } |