public void Dispose() { ALC10.alcMakeContextCurrent(IntPtr.Zero); if (alContext != IntPtr.Zero) { ALC10.alcDestroyContext(alContext); alContext = IntPtr.Zero; } if (alDevice != IntPtr.Zero) { ALC10.alcCloseDevice(alDevice); alDevice = IntPtr.Zero; } Instance = null; }
public static void Initialize() { // We should only have one of these! if (Instance != null) { throw new Exception("OpenALDevice already created!"); } try { Instance = new OpenALDevice(); } catch (DllNotFoundException e) { System.Console.WriteLine("OpenAL not found! Need SDL2-CS.dll.config?"); throw e; } catch (Exception) { /* We ignore and device creation exceptions, * as they are handled down the line with Instance != null */ } }
public static void Initialize() { // We should only have one of these! if (Instance != null) { throw new Exception("OpenALDevice already created!"); } try { Instance = new OpenALDevice(); } catch(DllNotFoundException e) { System.Console.WriteLine("OpenAL not found! Need SDL2-CS.dll.config?"); throw e; } catch(Exception) { /* We ignore and device creation exceptions, * as they are handled down the line with Instance != null */ } }