Audio: Add an option to directly link OpenAL

This commit is contained in:
SirLynix
2022-12-06 07:48:03 +01:00
parent 98cf8b3d33
commit 2dd0e7d9c8
9 changed files with 218 additions and 175 deletions

View File

@@ -4,6 +4,7 @@
#include <Nazara/Audio/OpenALSource.hpp>
#include <Nazara/Audio/OpenALBuffer.hpp>
#include <Nazara/Audio/OpenALDevice.hpp>
#include <Nazara/Audio/OpenALLibrary.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
@@ -84,6 +85,7 @@ namespace Nz
auto OpenALSource::GetSampleOffsetAndLatency() const -> OffsetWithLatency
{
OffsetWithLatency offsetWithLatency;
#ifdef AL_SOFT_source_latency
if (GetDevice().IsExtensionSupported(OpenALExtension::SourceLatency))
{
GetDevice().MakeContextCurrent();
@@ -96,6 +98,7 @@ namespace Nz
}
else
#endif
{
offsetWithLatency.sampleOffset = GetSampleOffset() * 1'000;
offsetWithLatency.sourceLatency = 0;