Audio: Handle AudioBuffer compatibility

OpenAL buffers are shared between contextes
This commit is contained in:
Jérôme Leclercq
2022-03-17 13:36:09 +01:00
parent 01061380ee
commit 667a4a0c08
10 changed files with 44 additions and 9 deletions

View File

@@ -52,6 +52,12 @@ namespace Nz
return SafeCast<UInt32>(sampleRate);
}
bool OpenALBuffer::IsCompatibleWith(const AudioDevice& device) const
{
// OpenAL buffers are shared among contexts and thus devices
return device.GetSubSystemIdentifier() == &m_library;
}
bool OpenALBuffer::Reset(AudioFormat format, UInt64 sampleCount, UInt32 sampleRate, const void* samples)
{
OpenALDevice& device = GetDevice();