|
|
@@ -155,7 +155,22 @@ OpenALAudioManager() {
|
|
|
if (_device != nullptr) {
|
|
|
// We managed to get a device open.
|
|
|
alcGetError(_device); // clear errors
|
|
|
- _context = alcCreateContext(_device, nullptr);
|
|
|
+
|
|
|
+ ALCboolean is_hrtf_present = alcIsExtensionPresent(_device, "ALC_SOFT_HRTF");
|
|
|
+
|
|
|
+ ALCint attrs[3] = {0};
|
|
|
+
|
|
|
+#ifndef HAVE_OPENAL_FRAMEWORK
|
|
|
+ if (is_hrtf_present) {
|
|
|
+ attrs[0] = ALC_HRTF_SOFT;
|
|
|
+ attrs[1] = audio_want_hrtf.get_value() ? ALC_TRUE : ALC_FALSE;
|
|
|
+ attrs[2] = 0; // end of list
|
|
|
+ } else {
|
|
|
+ attrs[0] = 0; // end of list
|
|
|
+ }
|
|
|
+#endif // HAVE_OPENAL_FRAMEWORK
|
|
|
+
|
|
|
+ _context = alcCreateContext(_device, attrs);
|
|
|
alc_audio_errcheck("alcCreateContext(_device, NULL)", _device);
|
|
|
if (_context != nullptr) {
|
|
|
_openal_active = true;
|