Error when positioning stereo sources;

This commit is contained in:
bjorn 2017-02-26 13:24:22 -08:00
parent 2a6afc4999
commit 13db69a2fb
1 changed files with 8 additions and 0 deletions

View File

@ -175,6 +175,10 @@ void lovrSourceSetDirection(Source* source, float x, float y, float z) {
}
void lovrSourceSetFalloff(Source* source, float reference, float max, float rolloff) {
if (lovrSourceGetChannels(source) != 1) {
error("Positional audio is only supported for mono sources.");
}
alSourcef(source->id, AL_REFERENCE_DISTANCE, reference);
alSourcef(source->id, AL_MAX_DISTANCE, max);
alSourcef(source->id, AL_ROLLOFF_FACTOR, rolloff);
@ -189,6 +193,10 @@ void lovrSourceSetPitch(Source* source, float pitch) {
}
void lovrSourceSetPosition(Source* source, float x, float y, float z) {
if (lovrSourceGetChannels(source) != 1) {
error("Positional audio is only supported for mono sources.");
}
alSource3f(source->id, AL_POSITION, x, y, z);
}