Posted this question on SO but got no answers. Maybe somebody can help me here.
I recently had a well-working program which streamed WAV and Ogg sounds with OpenAL. I then decided to abstract the source and buffer objects into C++ classes. I got as far as the source class. My function which returns the number of processed buffers is not altering the integer passed to alGetSourcei
.
int ALSource::GetBuffersProcessed() const {
ALint processed;
alGetSourcei(this->source, AL_BUFFERS_PROCESSED, &processed);
int error = alGetError();
if(error != AL_NO_ERROR)
return -1;
return processed;
}
I checked that error
is never anything but AL_NO_ERROR
. I generate the source in the
constructor:
alGenSources(1, &source);
This also never gives any error.
The actual symptom of this is that processed
is declared but not initialised. It's final value is the initial junk value that it starts out with. (Usually something like -8834824334).
Would this be expected behaviour? The OpenAL specification states that the value should be from 0 - any
but is not really any more specific than that. The programmers' guide is the same.