diff options
Diffstat (limited to 'src/library_openal.js')
-rw-r--r-- | src/library_openal.js | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/src/library_openal.js b/src/library_openal.js index 271ae5ae..11ef1fbb 100644 --- a/src/library_openal.js +++ b/src/library_openal.js @@ -57,6 +57,7 @@ var LibraryOpenAL = { } if (ctx) { + ctx.listener.panningModel = "equalpower"; AL.contexts.push({ctx: ctx, err: 0, src: [], buf: []}); return AL.contexts.length; } else { @@ -517,9 +518,43 @@ var LibraryOpenAL = { }, alListenerfv: function(param, values) { + if (!AL.currentContext) { #if OPENAL_DEBUG - console.log("alListenerfv is not supported yet"); + console.error("alListenerfv called without a valid context"); #endif + return; + } + switch (param) { + case 0x1004 /* AL_POSITION */: + AL.currentContext.ctx.listener.setPosition( + {{{ makeGetValue('values', '0', 'float') }}}, + {{{ makeGetValue('values', '1', 'float') }}}, + {{{ makeGetValue('values', '2', 'float') }}} + ); + break; + case 0x1006 /* AL_VELOCITY */: + AL.currentContext.ctx.listener.setVelocity( + {{{ makeGetValue('values', '0', 'float') }}}, + {{{ makeGetValue('values', '1', 'float') }}}, + {{{ makeGetValue('values', '2', 'float') }}} + ); + break; + case 0x100F /* AL_ORIENTATION */: + AL.currentContext.ctx.listener.setOrientation( + {{{ makeGetValue('values', '0', 'float') }}}, + {{{ makeGetValue('values', '1', 'float') }}}, + {{{ makeGetValue('values', '2', 'float') }}}, + {{{ makeGetValue('values', '3', 'float') }}}, + {{{ makeGetValue('values', '4', 'float') }}}, + {{{ makeGetValue('values', '5', 'float') }}} + ); + break; + default: +#if OPENAL_DEBUG + console.log("alListenerfv with param " + param + " not implemented yet"); +#endif + break; + } }, alIsExtensionPresent: function(extName) { |