Added position audio.

This commit is contained in:
rude
2009-08-04 21:13:32 +02:00
parent 73b37f626d
commit cc9a142a98
14 changed files with 340 additions and 1 deletions
+30
View File
@@ -175,6 +175,36 @@ namespace openal
return volume;
}
void Audio::getPosition(float * v) const
{
alGetListenerfv(AL_POSITION, v);
}
void Audio::setPosition(float * v)
{
alListenerfv(AL_POSITION, v);
}
void Audio::getOrientation(float * v) const
{
alGetListenerfv(AL_ORIENTATION, v);
}
void Audio::setOrientation(float * v)
{
alListenerfv(AL_ORIENTATION, v);
}
void Audio::getVelocity(float * v) const
{
alGetListenerfv(AL_VELOCITY, v);
}
void Audio::setVelocity(float * v)
{
alListenerfv(AL_VELOCITY, v);
}
} // openal
} // audio
} // love
+7
View File
@@ -96,6 +96,13 @@ namespace openal
void setVolume(float volume);
float getVolume() const;
void getPosition(float * v) const;
void setPosition(float * v);
void getOrientation(float * v) const;
void setOrientation(float * v);
void getVelocity(float * v) const;
void setVelocity(float * v);
}; // Audio
} // openal
+36
View File
@@ -163,6 +163,42 @@ namespace openal
return volume;
}
void Source::setPosition(float * v)
{
if(source)
alSourcefv(source, AL_POSITION, v);
}
void Source::getPosition(float * v) const
{
if(source)
alGetSourcefv(source, AL_POSITION, v);
}
void Source::setVelocity(float * v)
{
if(source)
alSourcefv(source, AL_VELOCITY, v);
}
void Source::getVelocity(float * v) const
{
if(source)
alGetSourcefv(source, AL_VELOCITY, v);
}
void Source::setDirection(float * v)
{
if(source)
alSourcefv(source, AL_DIRECTION, v);
}
void Source::getDirection(float * v) const
{
if(source)
alGetSourcefv(source, AL_DIRECTION, v);
}
} // openal
} // audio
} // love
+7
View File
@@ -67,6 +67,13 @@ namespace openal
void setVolume(float volume);
float getVolume() const;
void setPosition(float * v);
void getPosition(float * v) const;
void setVelocity(float * v);
void getVelocity(float * v) const;
void setDirection(float * v);
void getDirection(float * v) const;
}; // Source
} // openal