alGetSourcei and AL_BUFFERS_PROCESSED gives junk.
Mr Anthony Arnold <[email protected]>
| Newsgroups | gmane.comp.lib.openal |
|---|---|
| Message-ID | <1D0157C45F596B4F91D1FA538A5924A86F80D546@BL2PRD0103MB041.prod.exchangelabs.com> |
Hi everyone,
New to this list but cannot seem to figure out the problem myself. I am on a windows platform with OpenAL 1.1 static binaries.
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 so its 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.
I am quite sure I have created a context and generated the source correctly (otherwise it would give errors, right?)
Thanks for any help you can give me!
AArnold.
_______________________________________________
Openal mailing list
[email protected]
http://opensource.creative.com/mailman/listinfo/openal