public static Context CreateAndActivate(PlaybackDevice device) { Context c = Create(device); c.Activate(); return(c); }
internal Context(IntPtr handle, PlaybackDevice device) { this.Handle = handle; this.Device = device; OpenAL.DebugFormat("Context {0} created for {1}", handle, device.Name); }
internal Context(IntPtr handle, PlaybackDevice device) { this.Handle = handle; this.Device = device; OpenAL.DebugFormat ("Context {0} created for {1}", handle, device.Name); }
// ReSharper restore InconsistentNaming public static Context Create(PlaybackDevice device) { OpenAL.DebugFormat("Creating context for {0}", device.Name); Context c = new Context(alcCreateContext(device.Handle, IntPtr.Zero), device); OpenAL.ErrorCheck(device); device.Context = c; return(c); }
public static IEnumerable <PlaybackDevice> GetPlaybackDevices(out PlaybackDevice defaultDevice) { defaultDevice = null; OpenAL.Debug("Getting playback devices"); string defaultName = null; string[] strings = new string[0]; if (GetIsExtensionPresent("ALC_ENUMERATE_ALL_EXT")) { defaultName = Marshal.PtrToStringAnsi(alcGetString(IntPtr.Zero, ALC_DEFAULT_ALL_DEVICES_SPECIFIER)); strings = ReadStringsFromMemory(alcGetString(IntPtr.Zero, ALC_ALL_DEVICES_SPECIFIER)); } else if (GetIsExtensionPresent("ALC_ENUMERATION_EXT")) { defaultName = Marshal.PtrToStringAnsi(alcGetString(IntPtr.Zero, ALC_DEFAULT_DEVICE_SPECIFIER)); strings = ReadStringsFromMemory(alcGetString(IntPtr.Zero, ALC_DEVICE_SPECIFIER)); } PlaybackDevice[] devices = new PlaybackDevice[strings.Length]; for (int i = 0; i < strings.Length; ++i) { string s = strings[i]; devices[i] = new PlaybackDevice(s); if (s == defaultName) { defaultDevice = devices[i]; } OpenAL.DebugFormat("Found playback device {0}{1}", s, (s == defaultName) ? " (Default)" : String.Empty); } return(devices); }
public static Context CreateAndActivate(PlaybackDevice device) { Context c = Create (device); c.Activate (); return c; }
// ReSharper restore InconsistentNaming public static Context Create(PlaybackDevice device) { OpenAL.DebugFormat ("Creating context for {0}", device.Name); Context c = new Context (alcCreateContext (device.Handle, IntPtr.Zero), device); OpenAL.ErrorCheck (device); device.Context = c; return c; }
public static IEnumerable<PlaybackDevice> GetPlaybackDevices(out PlaybackDevice defaultDevice) { defaultDevice = null; OpenAL.Debug ("Getting playback devices"); string defaultName = null; string[] strings = new string[0]; if (GetIsExtensionPresent ("ALC_ENUMERATE_ALL_EXT")) { defaultName = Marshal.PtrToStringAnsi (alcGetString (IntPtr.Zero, ALC_DEFAULT_ALL_DEVICES_SPECIFIER)); strings = ReadStringsFromMemory (alcGetString (IntPtr.Zero, ALC_ALL_DEVICES_SPECIFIER)); } else if (GetIsExtensionPresent ("ALC_ENUMERATION_EXT")) { defaultName = Marshal.PtrToStringAnsi (alcGetString (IntPtr.Zero, ALC_DEFAULT_DEVICE_SPECIFIER)); strings = ReadStringsFromMemory (alcGetString (IntPtr.Zero, ALC_DEVICE_SPECIFIER)); } PlaybackDevice[] devices = new PlaybackDevice[strings.Length]; for (int i = 0; i < strings.Length; ++i) { string s = strings[i]; devices[i] = new PlaybackDevice (s); if (s == defaultName) defaultDevice = devices[i]; OpenAL.DebugFormat ("Found playback device {0}{1}", s, (s == defaultName) ? " (Default)" : String.Empty); } return devices; }