Пример #1
0
 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;
 }
Пример #2
0
        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
                 */
            }
        }
Пример #3
0
        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
                 */
            }
        }
Пример #4
0
 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;
 }