mirror of https://github.com/bjornbytes/lovr.git
Error when positioning stereo sources;
This commit is contained in:
parent
2a6afc4999
commit
13db69a2fb
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue