I'm just beginning to learn OpenAL, but I think I have stumbled onto an incorrect javadoc entry for the mentioned function. The OpenAL programmers manual states the following:
Parameters:
source - the name of the source to unqueue buffers from
n - the number of buffers to be unqueued
buffers - a pointer to an array of buffer names that were removed
WERE removed, which tells me that alSourceUnqueueBuffers() determines the buffer names to be removed, not the game code. The game code only specifies the AMOUNT of buffers to remove (with 'n', which in LWJGL is the amount of remaining integers in the IntBuffer).
Yet the javadoc states the following:
Parameters:
source - source to unqueue buffers from
buffers - buffers to be unqueued
Like you have to specify yourself which buffers should be unqueued.
Am I reading the OpenAL docs wrong, or is the javadoc incorrect / missing some details? If I am reading the OpenAL docs correctly, then all you have to do is:
1) query the AL_BUFFERS_PROCESSED value using alGetSourcei()
2) create an IntBuffer of size 'AL_BUFFERS_PROCESSED'
3) call alSourceUnqueueBuffers() and pass the created IntBuffer
Then after the call is completed the IntBuffer contains all the names of the buffers that were unqueued, right?