public ALDevice(string deviceName) { _device = Alc.alcOpenDevice(deviceName); if (_device == IntPtr.Zero) throw new InvalidOperationException(string.Format("Device {0} is not on your system.", deviceName)); _context = Alc.alcCreateContext(_device, IntPtr.Zero); Alc.alcMakeContextCurrent(_context); Listener = new ALListener(); }
public MainForm() { InitializeComponent(); try { _device = new ALDevice("Rapture3D"); } catch (Exception ex) { MessageBox.Show("Couldn't create the device." + Environment.NewLine + ex.Message, "Error Acquiring Device", MessageBoxButtons.OK, MessageBoxIcon.Error); _closeImmediately = true; return; } _listener = new ALListener(); _listener.Position = new Vector3(100, 100, 100); }