aboutsummaryrefslogtreecommitdiff
path: root/src/library_openal.js
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2013-03-13 19:18:36 -0400
committerAlon Zakai <alonzakai@gmail.com>2013-03-15 11:53:16 -0700
commitd12ae480205a5a44b2d7d583ab7b04b1680e0c59 (patch)
tree4ddd23e3c0a44cad76097879b99cbe1ad85824e3 /src/library_openal.js
parent8d03c4d69b31a62114018e5c5ddf96ee1746dbb8 (diff)
Implement alSourcePlay
Diffstat (limited to 'src/library_openal.js')
-rw-r--r--src/library_openal.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/library_openal.js b/src/library_openal.js
index a1ce6f82..58b394ba 100644
--- a/src/library_openal.js
+++ b/src/library_openal.js
@@ -253,6 +253,18 @@ var LibraryOpenAL = {
}
},
+ alSourcePlay: function(source) {
+ if (!AL.currentContext) {
+ console.error("alSourceQueueBuffers called without a valid context");
+ return;
+ }
+ if (source > AL.currentContext.src.length) {
+ console.error("alSourceQueueBuffers called with an invalid source");
+ return;
+ }
+ AL.currentContext.src[source - 1].src.start(0);
+ },
+
alDistanceModel: function(model) {
if (model != 0 /* AL_NONE */) {
console.log("Only alDistanceModel(AL_NONE) is currently supported");