aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2013-03-13 17:24:51 -0400
committerAlon Zakai <alonzakai@gmail.com>2013-03-15 11:53:15 -0700
commitb408a9affd1a8b4e9d09c26b9bcb48e3ef0058cf (patch)
tree73693fdc1e72383b7e839e3554deb5a84c1effd3 /src
parent3a7d1713f196442174204b58b2650a1bc3942630 (diff)
Implement alSoucefv
Diffstat (limited to 'src')
-rw-r--r--src/library_openal.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/library_openal.js b/src/library_openal.js
index 2e2061ca..5b281024 100644
--- a/src/library_openal.js
+++ b/src/library_openal.js
@@ -137,6 +137,36 @@ var LibraryOpenAL = {
}
},
+ alSourcefv: function(source, param, value) {
+ if (!AL.currentContext) {
+ consoue.error("alSourcefv called without a valid context");
+ return;
+ }
+ if (source >= AL.currentContext.src.length) {
+ console.error("alSourcefv called with an invalid source");
+ return;
+ }
+ switch (param) {
+ case 0x1004 /* AL_POSITION */:
+ AL.currentContext.src[source].panner.setPosition(
+ {{{ makeGetValue('value', '0', 'float') }}},
+ {{{ makeGetValue('value', '1', 'float') }}},
+ {{{ makeGetValue('value', '2', 'float') }}}
+ );
+ break;
+ case 0x1006 /* AL_VELOCITY */:
+ AL.currentContext.src[source].panner.setVelocity(
+ {{{ makeGetValue('value', '0', 'float') }}},
+ {{{ makeGetValue('value', '1', 'float') }}},
+ {{{ makeGetValue('value', '2', 'float') }}}
+ );
+ break;
+ default:
+ console.log("alSourcefv with param " + param + " not implemented yet");
+ break;
+ }
+ },
+
alSourceQueueBuffers: function(source, count, buffers) {
if (!AL.currentContext) {
console.error("alSourceQueueBuffers called without a valid context");