diff options
Diffstat (limited to 'src/library_openal.js')
-rw-r--r-- | src/library_openal.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/library_openal.js b/src/library_openal.js index f9d96f6f..e9dafd66 100644 --- a/src/library_openal.js +++ b/src/library_openal.js @@ -226,6 +226,25 @@ var LibraryOpenAL = { } }, + alDeleteBuffers: function(count, buffers) + { + if (!AL.currentContext) { + console.error("alDeleteBuffers called without a valid context"); + return; + } + for (var i = 0; i < count; ++i) { + var bufferIdx = {{{ makeGetValue('buffers', 'i', 'i32') }}} - 1; + var buffer = AL.currentContext.buf[bufferIdx].buf; + for (var j = 0; j < AL.currentContext.src.length; ++j) { + if (buffer == AL.currentContext.src[j].buffer) { + AL.currentContext.err = 0xA004 /* AL_INVALID_OPERATION */; + return; + } + } + delete AL.currentContext.buf[bufferIdx]; + } + }, + alGenBuffers: function(count, buffers) { if (!AL.currentContext) { console.error("alGenBuffers called without a valid context"); |