mirror of
https://github.com/bjornbytes/lovr.git
synced 2024-07-05 13:53:38 +00:00
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) {
|
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_REFERENCE_DISTANCE, reference);
|
||||||
alSourcef(source->id, AL_MAX_DISTANCE, max);
|
alSourcef(source->id, AL_MAX_DISTANCE, max);
|
||||||
alSourcef(source->id, AL_ROLLOFF_FACTOR, rolloff);
|
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) {
|
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);
|
alSource3f(source->id, AL_POSITION, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue