aboutsummaryrefslogtreecommitdiff
path: root/src/library_openal.js
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2013-03-19 18:34:34 -0400
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2013-03-19 18:34:34 -0400
commit104f25c2e591d9b88752bbd9492c0ff8c74d997b (patch)
tree01859b6a4c6f6d66b15724b61bf387b26dc11cf9 /src/library_openal.js
parent7c71bf1d0ab8feb685a256de74abcae8c6a56f68 (diff)
Implement alListenerfv
Diffstat (limited to 'src/library_openal.js')
-rw-r--r--src/library_openal.js36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/library_openal.js b/src/library_openal.js
index 271ae5ae..80fed9f7 100644
--- a/src/library_openal.js
+++ b/src/library_openal.js
@@ -517,9 +517,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('value', '0', 'float') }}},
+ {{{ makeGetValue('value', '1', 'float') }}},
+ {{{ makeGetValue('value', '2', 'float') }}}
+ );
+ break;
+ case 0x1006 /* AL_VELOCITY */:
+ AL.currentContext.ctx.listener.setVelocity(
+ {{{ makeGetValue('value', '0', 'float') }}},
+ {{{ makeGetValue('value', '1', 'float') }}},
+ {{{ makeGetValue('value', '2', 'float') }}}
+ );
+ break;
+ case 0x100F /* AL_ORIENTATION */:
+ AL.currentContext.ctx.listener.setOrientation(
+ {{{ makeGetValue('value', '0', 'float') }}},
+ {{{ makeGetValue('value', '1', 'float') }}},
+ {{{ makeGetValue('value', '2', 'float') }}},
+ {{{ makeGetValue('value', '3', 'float') }}},
+ {{{ makeGetValue('value', '4', 'float') }}},
+ {{{ makeGetValue('value', '5', 'float') }}}
+ );
+ break;
+ default:
+#if OPENAL_DEBUG
+ console.log("alListenerfv with param " + param + " not implemented yet");
+#endif
+ break;
+ }
},
alIsExtensionPresent: function(extName) {