Exemplo n.º 1
0
 internal void Destroy()
 {
     // notify all sources first
     foreach (var source in _sources)
     {
         source.OnContextDestroyed();
     }
     ALC10.alcDestroyContext(Handle);
 }
Exemplo n.º 2
0
        protected override void Dispose(bool disposeManagedResources)
        {
            base.Dispose(disposeManagedResources);
            _sources.Clear();
            _files.Clear();


            ALC10.alcMakeContextCurrent(IntPtr.Zero);
            ALC10.alcDestroyContext(_context);
            ALC10.alcCloseDevice(_device);
        }
Exemplo n.º 3
0
        public void Dispose()
        {
            if (_context != IntPtr.Zero)
            {
                ALC10.alcMakeContextCurrent(IntPtr.Zero); Check();
                ALC10.alcDestroyContext(_context); Check();
            }

            if (_device != IntPtr.Zero)
            {
                ALC10.alcCloseDevice(_device);
                Check();
            }
        }
Exemplo n.º 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;
     }
 }
Exemplo n.º 5
0
        void Dispose(bool disposing)
        {
            if (context != IntPtr.Zero)
            {
                ALC10.alcMakeContextCurrent(IntPtr.Zero);
                ALC10.alcDestroyContext(context);
                context = IntPtr.Zero;
            }

            if (device != IntPtr.Zero)
            {
                ALC10.alcCloseDevice(device);
                device = IntPtr.Zero;
            }
        }
Exemplo n.º 6
0
        public void Dispose()
        {
            EFX.alDeleteFilters(1, ref INTERNAL_alFilter);

            ALC10.alcMakeContextCurrent(IntPtr.Zero);
            if (alContext != IntPtr.Zero)
            {
                ALC10.alcDestroyContext(alContext);
                alContext = IntPtr.Zero;
            }
            if (alDevice != IntPtr.Zero)
            {
                ALC10.alcCloseDevice(alDevice);
                alDevice = IntPtr.Zero;
            }
        }
Exemplo n.º 7
0
        void InnerDispose()
        {
            if (_disposed)
            {
                return;
            }

            if (_context != IntPtr.Zero)
            {
                ALC10.alcMakeContextCurrent(IntPtr.Zero); Check();
                ALC10.alcDestroyContext(_context); Check();
            }

            if (_device != IntPtr.Zero)
            {
                ALC10.alcCloseDevice(_device);
                Check();
            }

            _disposed = true;
        }
Exemplo n.º 8
0
        public static void Shutdown()
        {
            // Destroy the sources
            AL10.alDeleteSources(MAX_SOURCE_COUNT, s_allSources);
            ALUtils.CheckALError("unable to free audio sources");
            s_availableSources.Clear();
            s_usedSources.Clear();

            // Destroy the context, and then close the device
            ALC10.alcMakeContextCurrent(IntPtr.Zero);
            ALUtils.CheckALCError();
            ALC10.alcDestroyContext(Context);
            ALUtils.CheckALCError();
            Context = IntPtr.Zero;
            ALC10.alcCloseDevice(Device);
            ALUtils.CheckALCError();
            Device = IntPtr.Zero;

            IsShutdown = true;

            // Report
            LINFO("Shutdown OpenAL audio engine.");
        }