Files
NazaraEngine/include/Nazara/Audio/OpenALDevice.inl
SirLynix b5576ccb9f Audio: Fix data race when a device is used from multiple threads
OpenAL devices can be used from multiple threads and the error handling code (inspired by OpenGLRenderer) did not take that into account. This is not a problem for the OpenGLRenderer since contexts are thread-local which is not the case for OpenAL devices.
2023-12-04 11:01:01 +01:00

38 lines
938 B
C++

// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Audio/Debug.hpp>
namespace Nz
{
inline ALFunction OpenALDevice::GetFunctionByIndex(std::size_t funcIndex) const
{
assert(funcIndex < m_originalFunctionPointer.size());
return m_originalFunctionPointer[funcIndex];
}
inline OpenALLibrary& OpenALDevice::GetLibrary()
{
return m_library;
}
inline const OpenALLibrary& OpenALDevice::GetLibrary() const
{
return m_library;
}
inline bool OpenALDevice::IsExtensionSupported(OpenALExtension extension) const
{
return m_extensionStatus[extension];
}
inline ALenum OpenALDevice::TranslateAudioFormat(AudioFormat format) const
{
return m_audioFormatValues[format];
}
}
#include <Nazara/Audio/DebugOff.hpp>