Skip to content

Instantly share code, notes, and snippets.

@Fahrradkette
Last active December 20, 2015 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fahrradkette/6049434 to your computer and use it in GitHub Desktop.
Save Fahrradkette/6049434 to your computer and use it in GitHub Desktop.
Closes actual device
private static void OpenAlCloseDevice()
{
StopAllSounds();
IntPtr Context, Device;
Al.alDeleteBuffers(1, ref buffer);
Al.alDeleteSources(1, ref source);
Context = Alc.alcGetCurrentContext();
Device = Alc.alcGetContextsDevice(Context);
Alc.alcMakeContextCurrent(IntPtr.Zero);
Alc.alcDestroyContext(Context);
Alc.alcCloseDevice(Device);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment